1

My first SQLCLR project is resisting all attempts to deploy...

I get the error

The following error might appear if you deploy a SQL CLR project that was built for a version of the .NET Framework that is incompatible with the target instance of SQL Server: "Deploy error SQL01268: CREATE ASSEMBLY for assembly failed because assembly failed verification". To resolve this issue, open the properties for the project, and change the .NET Framework version.

C:...\SqlClr.dll : Deploy error : Could not create a type for parameter MyModel.Customer customer

The command

select * from sys.dm_clr_properties

returns

directory C:\Windows\Microsoft.NET\Framework64\v2.0.50727\

version v2.0.50727

state CLR is initialized

The Target framework for the project is .NET Framework 2.0

The object referenced in the error message MyModel.Customer is included in the SqlClr project via a Link (Add Existing Item / Add as Link) from another project that is using .NET Framework 4.0, but my understanding is the other project's .NET version should have no bearing.

What might I be missing?

2
  • Conditional compilation perhaps to exclude that? Commented Mar 27, 2012 at 5:42
  • @leppie: Exclude what? I need MyModel.Customer as it transports the data my SQLCLR procedure needs. Commented Mar 27, 2012 at 18:57

1 Answer 1

3

If you are referencing an assembly that is dependent upon .NET 4.0, you're likely in for trouble. My understanding is that SQLCLR assemblies must be based on .NET versions 2.0 through 3.5, because versions 2.x and later prior to 4.0 are really just extensions based on 2.0. That tends to coincide with some information I read recently about an explicit decision for the SQLCLR not to support Framework 4.0.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.