Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
CREATE ASSEMBLY CLRDemo FROM 'C:\Users\.......\Projects\CLRDemo\CLRDemo\bin\Debug\CLRDemo.dll' WITH PERMISSION_SET = SAFE;


I use this code to create assembly in sql.

But it is giving this error.
Assembly 'CLRDemo' references assembly 'system.runtime.serialization, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request.


What I have tried:

Not tried , because before it i have create but i drop that assembly. After that i want to create but it is giving error to me.
Posted
Updated 18-Jul-18 1:03am

1 solution

You need to register the missing assembly in the database as well, just like the error says. A good explanation can be found in Answer #2 at c# - Sql Server CLR load assembly failed - Stack Overflow[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900