Results 1 to 11 of 11

Thread: [RESOLVED] SqlServer.Management.Smo.Server object crashing

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Resolved [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?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,350

    Re: SqlServer.Management.Smo.Server object crashing

    Quote Originally Posted by robertx View Post
    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?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Re: SqlServer.Management.Smo.Server object crashing

    Quote Originally Posted by jmcilhinney View Post
    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.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,350

    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?

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Re: SqlServer.Management.Smo.Server object crashing

    Quote Originally Posted by jmcilhinney View Post
    So is it maybe then a freeze rather than a crash, i.e. a method call never returns rather than throwing an exception?
    Correct

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,350

    Re: SqlServer.Management.Smo.Server object crashing

    Can you show us the code and highlight the line that freezes?

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Re: SqlServer.Management.Smo.Server object crashing

    Quote Originally Posted by jmcilhinney View Post
    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.

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    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.

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    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.

  10. #10

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    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.

  11. #11

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    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
  •  



Click Here to Expand Forum to Full Width