Error: Could not load file or assembly 'System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The module was expected to contain an assembly manifest.

Recently, I was trouble shooting an error for my friend.  Despite having all the necessary framework and service packs installed, this error “Could not load file or assembly 'System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The module was expected to contain an assembly manifest.  was surfacing, every time we tried connecting to a SQL Server instance using SQL Server Management Studio.

At first, I thought the issue must be with SQL Server and tried reinstalling SQL Server.   During the installation, the SQL Server Agent, SQL Server Instance and SQL Full-text filter would fail while the rest of the components install successfully.  Again, the Management Studio would fail with the above error while trying to connect to an instance running on a server (same is the case with local as well)

Then I tried reinstalling Visual Studio 2008.  It installed although there seemed to be some issue somewhere during the installation.  Trying to reinstall the Service Pack 1, repairing it, didn’t solve the issue and I was again hitting the road block.

When I did a search, there were hardly any links on an elaborate error message like above although I found one (http://forums.asp.net/t/1145885.aspx)

The solution mentioned was talking about a possible GAC Failure for System.Transactions (System.Transactions is a part of .NET 2.0 and in the machine it was already installed although some how it had been removed from GAC i.e. C:\Windows\Assembly).

Now, I found this DLL (System.Transactions) in C:\Windows\Microsoft.NET\Framework\v2.0.50727

I had to install this into GAC. 

If you are running Visual Studio 2005, then gacutil.exe must be present inside “C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin

You would have to navigate to the above location in cmd prompt (elevated mode in Vista) and then execute

gacutil -I "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Transactions.dll"

If you are running Visual Studio 2008, you could use the Visual Studio 2008 Command Prompt (Start-All Programs-Microsoft Visual Studio 2008 – Visual Studio Tools – Visual Studio 2008 Command Prompt) and execute the above command.

Once you do that, you should be able to proceed with SQL Server installation as well as connect with other database servers or to put it simply, get rid of the above error in some other scenario.

The other error that was appearing occasionally before I did the above fix, in SQL Server Management Studio, was

Cannot connect to <servername>

ADDITIONAL INFORMATION

“The system cannot find the file specified. (Exception from HRESULT: 0x80070002) (System.Data)”

This got solved as well after I GACed the System.Transactions DLL in my scenario but if there is an alternate solution, please post in comments.

Cheers !!!

Print | posted on Wednesday, May 27, 2009 6:27 PM

Comments on this post

No comments posted yet.

Your comment:

 (will show your gravatar)