Web Images Videos Maps News Shopping Google Mail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion VS 2005 LoaderLock problem
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Dan  
View profile   Translate to Translated (View Original)
 More options 31 Mar 2006, 14:19
Newsgroups: microsoft.public.dotnet.framework
From: Dan <D...@discussions.microsoft.com>
Date: Fri, 31 Mar 2006 05:19:02 -0800
Local: Fri 31 Mar 2006 14:19
Subject: RE: VS 2005 LoaderLock problem
Hi,
I'm using Microsoft Sql Management Objects (SMO) -  the sql 2005 version of
SQL_DMO) to obtain information about a table's schema.

I have this code:
List<SMOColumn> GetTableSchema( string tableName, bool onlyPKs )
{
     Database db = sqlSrv.Databases[ dbName ];
...

}

When I execute the code from VS 2005, at this line, I get this exception:
"LoaderLock was detected
Message: Attempting managed execution inside OS Loader lock. Do not attempt
to run managed code inside a DllMain or image initialization function since
doing so can cause the application to hang."
and the application hangs.

However, when I run the unit tests (with Nunit) that go into the same code,
the damn thing works flawlessly.

Why this exception appears and how can I get rid of it?

Many thanks,
Dan


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google