-
Mar 1st, 2015, 07:42 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] SqlServer.Management.Smo.Server object crashing
I am deploying an application with SQL Server 2014 Express and it is crashing with a non-specific "[application_name] is not working" error either when I create a Microsoft.SqlServer.Management.Smo.Server object or call its methods. I cannot replicate this on my development machine.
I simply want to check the database size on start up to ensure the 10GB express version limit is not approaching so I can warn the client.
I had to uninstall SQL Server 2014 Express from my development machine because for some reason it caused a conflict with my Visual Studio 2005 projects. My development machine is running SQL Server 2012 Express.
I am wondering whether I am referencing the wrong version of the DLL's for SQL Server 2014. In the project.references window, the versions of Microsoft.SqlServer.Smo, Microsoft.SqlServer.Management.Sdk.Sfc and Microsoft.SqlServer.ConnectionInfo are all showing as 11.0.0.0.
To achieve what I want to, I can just query the MDF file size where the client and server are the same machine but this is not always the case. Any ideas why this is happening and how I might resolve it?
-
Mar 1st, 2015, 09:11 PM
#2
Re: SqlServer.Management.Smo.Server object crashing
Originally Posted by robertx
I am deploying an application with SQL Server 2014 Express and it is crashing with a non-specific "[application_name] is not working" error either when I create a Microsoft.SqlServer.Management.Smo.Server object or call its methods.
A crash is an unhandled exception so the first order of business would be to handle it. Have you put some code in to catch the exception and report its specifics, because that information you've provided sounds like something reported to the user by the OS and not what the application actually knows about it?
-
Mar 1st, 2015, 09:32 PM
#3
Thread Starter
Frenzied Member
Re: SqlServer.Management.Smo.Server object crashing
Originally Posted by jmcilhinney
A crash is an unhandled exception so the first order of business would be to handle it. Have you put some code in to catch the exception and report its specifics, because that information you've provided sounds like something reported to the user by the OS and not what the application actually knows about it?
Yes I have tried wrapping the procedure in a Try block and capturing an error message but it makes no difference.
-
Mar 1st, 2015, 09:49 PM
#4
Re: SqlServer.Management.Smo.Server object crashing
So is it maybe then a freeze rather than a crash, i.e. a method call never returns rather than throwing an exception?
-
Mar 1st, 2015, 10:00 PM
#5
Thread Starter
Frenzied Member
Re: SqlServer.Management.Smo.Server object crashing
Originally Posted by jmcilhinney
So is it maybe then a freeze rather than a crash, i.e. a method call never returns rather than throwing an exception?
Correct
-
Mar 1st, 2015, 11:59 PM
#6
Re: SqlServer.Management.Smo.Server object crashing
Can you show us the code and highlight the line that freezes?
-
Mar 2nd, 2015, 12:18 AM
#7
Thread Starter
Frenzied Member
Re: SqlServer.Management.Smo.Server object crashing
Originally Posted by jmcilhinney
Can you show us the code and highlight the line that freezes?
I'll try and replicate this on another development workstation or write to a log file on a client's machine to identify the line that's causing the freezing.
-
Mar 2nd, 2015, 12:51 AM
#8
Thread Starter
Frenzied Member
Re: SqlServer.Management.Smo.Server object crashing
I can't replicate the issue on another development workstation running SQL Server Express 2014. The obvious difference to a client's machine is that it is running Visual Studio 2013.
-
Mar 4th, 2015, 03:23 AM
#9
Thread Starter
Frenzied Member
Re: SqlServer.Management.Smo.Server object crashing
It's freezing upon attempting to create the Server object:
Dim mySQLServer As New Microsoft.SqlServer.Management.Smo.Server(sServerName)
I added a call to write to a log file after each line of code in the function and the log file was empty so the above line appears to be the culprit.
-
Mar 6th, 2015, 09:48 PM
#10
Thread Starter
Frenzied Member
Re: SqlServer.Management.Smo.Server object crashing
This same freezing happened the other day and I discovered that someone had constructed the connection string and ommited all the delimiting semi-colons. It occurred upon assigning the ConnectionString property of the connection object. Not sure why these database related errors are causing this freezing rather than just throwing tidy catchable errors.
Last edited by robertx; Mar 9th, 2015 at 01:29 AM.
-
Mar 9th, 2015, 01:31 AM
#11
Thread Starter
Frenzied Member
Re: SqlServer.Management.Smo.Server object crashing
I resolved the SMO freezing issue by updating the references of the DLL's stated in my original post to v12.0.0.0
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|