Search code examples
c#t-sqlvisual-studio-2013sql-server-2012clr

How to create dll for sql assembly using Visual Studio 2013 express?


I am trying to created some CLR function using this official documentation. In order to create the dll I have download Visual Studio 2013 Express.

The issue is I am getting errors like this on build:

Error 1 The type or namespace name 'Data' does not exist in the namespace 'System' (are you missing an assembly reference?)

I am using the following template:

enter image description here

and using the solution found in the net setting net framework as target:

enter image description here

but is not working again.

Also, which version of the .NET Framework should I use for SQL Server 2012?


Solution

  • Your project type should be Class Library not Portable as on your screenshot.

    Be sure you've included reference to System.Data assembly in your project.

    SQL 2012 uses CLR 4.0 by default.

    UPDATE

    You should use VS Express 2013 for Windows Desktop (not "For Windows") in order to create Winforms apps and class libraries. See What is the difference between Visual Studio Express 2013 for Windows and Visual Studio Express 2013 for Windows Desktop?