I have Visual Studio 2010 Professional and SQL Server 2014. I have created a very simple SQL CLR database application which will just printing a message after an insertion happen in a table. There is no error when I build the application but whenever I try to deploy it I am getting the error:
SqlClrDeploy:
Beginning deployment of assembly TestCLR.dll to server WIN-GECJT\SQLEXPRESS : Checkbox
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:\ProgramFiles\MSBuild\Microsoft\VisualStudiov10.0\TeamDataMicrosoft.Data.Schema.SqlClr.targets(96,5): Deploy error SQL01234: The database version is not supported.
Build FAILED.
I have also tested it by changing my project's target framework to 2.0 and 3.5 but getting the same error every time.
When I run the below command to see My SQL Server 2014 CLR version:
select * from sys.dm_clr_properties;
It shows me version v4.0.30319
If Visual Studio 2010 and SQL Server 2014 has the same version v4.0 then why I am getting this compatibility error?
Or we just cannot simply deploy SQL CLR 2010 project on SQL Server 2014?
First of all this is common issue for incompatibility between SQLCLR shipped with VS2010 and SQL Server newer versions (2012 to 2014).
In your case here the problem is raised from the template used to create the SQL Server solution , so VS2010 Template wont deploy to SQL Server 2012 or newer.
by upgrading the actual template to the latest one your issue disappear.
STEPS : On VS2010 Chose new Project. From templates Select as shown below (Other Languages -> SQL Server ->Sql Server Data Tools Database Projects (Web Insall)):
At this point you have to follow the steps to install SSDT 2012 or 2014 not 2010 (installation may take long time just let it go!!)
SSDT being installed Choose File --> New Project --> SQL Server Database Project
to create a new one ![New Project Dialog with SSDT 2012/2014 installed this time][2]
Or just Convert your existing Projects to the new installed Template as bellow ![Contextual Menu To Convert Existing Project to the new Template.][3]
Hope this Will Help.