CLR Executables Fail to Deploy

| 1 Comment

After having installed Visual Studio SP1 and SQL Server 2008, I wanted to make sure my existing CLR demos worked. I have a number of unique examples (that are included in my latest book) that illustrate basic to complex functions, stored procedures, aggregates and user-defined types--all implemented in CLR (Visual Basic.NET) languages.

So, I attached my existing Biblio example database to the new SQL Server 2008 instance and pulled up an existing (and working) example in Visual Studio 2008 (SP1). Since I wanted to be able to use step-through debugging, I switched to the X86 configuration (this is a 64-bit system and the Framework does not support 64-bit STD). This was my downfall. Once I clicked on F5 to compile, deploy and debug the example, it failed with:

An error occurred in the Microsoft .NET Framework while trying to load assembly id 65737. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues. For more information about this error:
System.IO.FileLoadException: Could not load file or assembly 'prjtablefromdelimitedlist, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
Sure, I checked Google and found a MS article on the issue--or it said it was. Unfortunately it did not help. I tried the other suggestions. I then created a new test database and tried to deploy the CLR function there. It worked. What was different? Well, in the second case, I had left the configuration on "Any CPU".

I filed a Connect bug. If you think this is an issue, vote for it. https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=361684

1 Comment

Actually I think this makes sense. Since you're on 64bit Windows you must be running 64bit SQL Server (32bit versions don't work on a 64bit Windows system)

Since this is the case then you will need to set the configuration to Any CPU for the CLR Database queries project to ensure that a 64bit version is created compatible with the 64bit database engine you have installed.

Pages

Powered by Movable Type 4.21-en

About this Entry

This page contains a single entry by William Vaughn published on August 13, 2008 1:05 PM.

DevTeach Comes to Toronto was the previous entry in this blog.

AdventureWorks 2008 Examples--Not So Easy to Install is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.