SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


mscorlib version=2.0.5.0 issue when trying to CREATE ASSEMBLY in SQL Server 2012


mscorlib version=2.0.5.0 issue when trying to CREATE ASSEMBLY in SQL Server 2012

Author
Message
bhee
bhee
SSC Journeyman
SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)

Group: General Forum Members
Points: 82 Visits: 34
Trying to CREATE ASSEMBLY in MS SQL Server 2012 SP1.
Assembly was developed in Visual Studio 2010 as a SQL Server Database Project targeting SQL Server 2012 platform and .NET Framework 4.

It references Google.Apis.Admin.Directory.directory_v1 as well as other DLLs included in the nuget package for this assembly.

Create ASSEMBLY [XXXX] from
'C:\Visual Studio 2010\Projects\XXXX\XXXX\bin\Debug\XXXX.dll'
WITH PERMISSION_SET = UNSAFE;
GO

Returns the following error.

Msg 10301, Level 16, State 1, Line 1
Assembly 'XXXX' references assembly 'mscorlib, version=2.0.5.0, culture=neutral, publickeytoken=7cec85d7bea7798e.', 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.

Has anyone encounter this issue?
damien.tiede
damien.tiede
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 3
Has anyone found a solution to this?
Sue_H
Sue_H
SSC Guru
SSC Guru (77K reputation)SSC Guru (77K reputation)SSC Guru (77K reputation)SSC Guru (77K reputation)SSC Guru (77K reputation)SSC Guru (77K reputation)SSC Guru (77K reputation)SSC Guru (77K reputation)

Group: General Forum Members
Points: 77624 Visits: 15517
damien.tiede - Thursday, February 22, 2018 1:45 PM
Has anyone found a solution to this?


Try changing your target framework to a higher version if you are getting the exact same message.

Sue



Alexander Zhang
Alexander Zhang
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1175 Visits: 264
bhee - Friday, March 13, 2015 8:28 AM
Trying to CREATE ASSEMBLY in MS SQL Server 2012 SP1.Assembly was developed in Visual Studio 2010 as a SQL Server Database Project targeting SQL Server 2012 platform and .NET Framework 4.It references Google.Apis.Admin.Directory.directory_v1 as well as other DLLs included in the nuget package for this assembly.Create ASSEMBLY [XXXX] from 'C:\Visual Studio 2010\Projects\XXXX\XXXX\bin\Debug\XXXX.dll' WITH PERMISSION_SET = UNSAFE;GOReturns the following error.Msg 10301, Level 16, State 1, Line 1Assembly 'XXXX' references assembly 'mscorlib, version=2.0.5.0, culture=neutral, publickeytoken=7cec85d7bea7798e.', 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.Has anyone encounter this issue?

I ran into the similar situation several times and was ever in pain for days. My final workaround is, to recompile the SQL CLR by .Net 3.5 or 2.0. I'm very happy if somebody here can figure out a way to fix it without the need to recompile SQL CLR.


GASQL.com - Focus on Database and Cloud
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum









































































































































































SQLServerCentral


Search