Issue with dependency on Microsoft.Threading.Tasks DLL
choban49 opened this issue · 9 comments
I have created a .Net CLR user defined function to make the API call to the GeoIP2 webservice so that I can integrate directly into SQL Server 2014.
When I attempt to load the assembly, it blows up on Microsoft.Threading.Tasks.DLL because this has a dependency on mscorlib 2.0.5.0. I can't load mscorlib 2.0.5.0 into the database as it already has 4.o.x in its stack, so I am at an impasse. Is there any way you can remove this dependency?
The current version of the DLL in question is 1.0.168 and that has the following reference in it
// Assembly Reference mscorlib
Version: 2.0.5.0
Name: mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes
Now System.Threading.Tasks.dll has the correct reference of;
// Assembly Reference mscorlib
Version: 4.0.0.0
Name: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
HELP!!!
Thanks,
Colm
Do you have https://support.microsoft.com/en-us/kb/2468871 installed?
Yes, that has been installed
On Fri, Oct 16, 2015 at 11:23 AM, Gregory Oschwald <notifications@github.com
wrote:
Do you have https://support.microsoft.com/en-us/kb/2468871 installed?
—
Reply to this email directly or view it on GitHub
#39 (comment)
.
Do you have Microsoft.Bcl.Async
installed?
Yes, that was a prerequisite dependency
ackage Manager Console Host Version 2.8.60723.765
Type 'get-help NuGet' to see all available NuGet commands.
PM> Install-Package Microsoft.Bcl.Async
Attempting to resolve dependency 'Microsoft.Bcl (≥ 1.1.8)'.
Attempting to resolve dependency 'Microsoft.Bcl.Build (≥ 1.0.14)'.
'Microsoft.Bcl.Async 1.0.168' already installed.
PM>
PM> Install-Package MaxMind.GeoIP2
Attempting to resolve dependency 'MaxMind.Db (≥ 1.2.0)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 7.0.1)'.
Attempting to resolve dependency 'Microsoft.Bcl.Async (≥ 1.0.168)'.
Attempting to resolve dependency 'Microsoft.Bcl (≥ 1.1.8)'.
Attempting to resolve dependency 'Microsoft.Bcl.Build (≥ 1.0.14)'.
Attempting to resolve dependency 'Microsoft.Net.Http (≥ 2.2.29)'.
'MaxMind.GeoIP2 2.4.0' already installed.
PM>
The following error message is what I get when I try to load the MaxMind.GeoIP2.dll into a SQL Server 2014 DB.
CREATE ASSEMBLY MaxMindGeoIP2
FROM 'C:.........\Visual Studio 2013\Projects\DBProjectCLRMaxMIndWS\DBProjectCLRMaxMIndWS\bin\Debug\MaxMind.GeoIP2.dll'
WITH PERMISSION_SET = EXTERNAL_ACCESS;
Msg 10301, Level 16, State 1, Line 1
Assembly 'MaxMind.GeoIP2' references assembly 'microsoft.threading.tasks, version=1.0.12.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.', 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.
Any Progress on this yet?
The dependency cannot be removed. We haven't been able to find a simple test case that demonstrates the issue. The only discussion I have found online is a bug that Microsoft fixes. If you could provide us with a project that demonstrates the issue without requiring it to be loaded into SQL Server, that would be useful.
Are you building this with .NET 4.5? It is possible that in the future we will package a separate 4.5 assembly that does not use the BCL libraries, which I assume are related to this issue. See #38.
You could also try using a 2.3.* release of this library. You will need to pin RestSharp at the minimum required version for those releases though as they released a breaking change without a major version bump.