VS SQLCLR: Function X has unresolved reference to schema Y
You need to create the Schema as well, as a separate SSDT object. It will not be automatically created for you just by specifying that you want to use it for your SQLCLR objects. You should be able to:
- Add New Item (Control + Shift + A) anywhere to your Project
- Select the template SQL Server > Security > Schema
- Name the Item / file:
decASM
- Save and close the script
It will create a separate SQL file in your project for this, containing a single command CREATE SCHEMA [decASM]
, and will deploy it when you publish your SQLCLR code.
The steps noted above did work for me using Visual Studio 2013.
You will have to set the Build Action
to Build
as well. Otherwise the error will keep showing.
In the following screenshot, Selective.sql
is the Schema object I added to my project. Hit F4 for the properties window.