Not able to deploy C# SQL CLR database project from Visual Studio 2010 to SQL Server 2014

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:

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.

  • Hangfire recurring job failed without any mention
  • SQL query to return only 1 record per group ID
  • how to group corresponding values in 2 columns in SQL?
  • Direct Sql or combine it in a procedure? which is more efficient
  • Deleting Tree-Nodes in a SQL table
  • WHERE IS NULL, IS NOT NULL or NO WHERE clause depending on SQL Server parameter value
  • 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?

  • Temp tables on the current connection
  • procedure to upload excel into sql server
  • SQL query to convert columns into rows
  • getting the last inserted id from previous insert statement
  • Are there any SQL Validators that can check syntax against multiple database servers?
  • How to pivot rows into colums dynamically SQL Server
  • One Solution collect form web for “Not able to deploy C# SQL CLR database project from Visual Studio 2010 to 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.

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.