Red Gate forums :: View topic - Command line "Object reference not set ..." error?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Compare 10
SQL Compare 10 forum

Command line "Object reference not set ..." error?

Search in SQL Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
freecell1



Joined: 13 Mar 2012
Posts: 20

PostPosted: Tue Mar 13, 2012 8:26 pm    Post subject: Command line "Object reference not set ..." error? Reply with quote

I have a build script that loops through a set of databases and executes a command line sqlcompare on each one (identical arguments). On one of the databases I get an error at the end of the comparison:


Unexpected error: Object reference not set to an instance of an object.
[15:11:57]: [Exec] Object reference not set to an instance of an object.
(stack trace follows)

This is running in TeamCity via MSBuild. If I run from a command line myself it works. Can anyone suggest possible causes or ways to troubleshoot?
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 755
Location: Red Gate Software Ltd.

PostPosted: Fri Mar 16, 2012 10:54 am    Post subject: Reply with quote

Thanks for your post.

Could you try turning on the command line logging? It might give a better idea where the problem is:

Quote:
/logLevel:<logLevel>
Alias: /log
Default: None

Sets a minumum log level

Log files collect information about the application while you are using it. These files are useful to us if you have encountered a problem. By default, logging is disabled and no log files are stored.

Value Alias Description
None n Disables logging.
Error e Reports serious and fatal errors. For example, an error message might report a failed operation.
Warning w Reports warning and error messages. For example, a warning message might report a handled exception, or a problem which does not prevent you from using the application.
Verbose v Reports all messages in the log file.


The logs are normally created in '%USERPROFILE%\AppData\Local\Red Gate\Logs\SQL Compare'
_________________
Chris
Back to top
View user's profile Send private message Send e-mail
freecell1



Joined: 13 Mar 2012
Posts: 20

PostPosted: Fri Mar 16, 2012 5:03 pm    Post subject: Reply with quote

I've figured it out. It had to do with having UNSAFE c# CLR assemblies on the server. In that scenario the user must be in the sql admins group for the comparison to work, it seems. THat's why it worked when I ran it but not when the build system did.

We actually ended up revisiting usage of CLR functions and we going to stop making new ones, and also exclude them from sql source control. The actual C# project code is already in svn anyway.

Thanks for the suggestion.

John
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group