Microsoft.SqlServer.Types version 10 or later not found on visual studio online

I've seen this issue on several questions, all solutions work fine when you build locally. I currently have my code on visualstudio.com and have an auto build when I push the code from my machine.

I know you need to install the nuget package (which I have) and set the types from the following link:

http://go.microsoft.com/fwlink/?LinkID=239644&clcid=0x409

The problem is I don't know how to install this from my browser as it is being built in the cloud.

Did I miss something?

+3


source to share


4 answers


I worked with the problem with support from Microsoft.

It was pretty simple actually, I added the following line of code to the object's constructor Context

:



SqlProviderServices.SqlServerTypesAssemblyName = "Microsoft.SqlServer.Types, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91";

      

It came from stackoverflow answer, but I lost the link. If anyone knows where this came from, feel free to comment on the link or mark it as a duplicate.

0


source


After all the clues I found on the internet didn't work for me, I want to make a doc for a solution that worked for me:

I installed the Nuget package and created the following redirect in app / web.config:



<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
  </dependentAssembly>
</assemblyBinding>    

      

I found the information I needed here: https://github.com/aspnet/EntityFramework6/issues/244

+1


source


Visual Studio Onlines TFS Build Server doesn't let you install anything on it. You have to do this with a NuGet package.

Add SQL CLR dependencies to your solution as a NuGet package.

enter image description here

This way the build server will restore the pre-build NuGet package:

enter image description here

If that doesn't work, try the Microsoft.SqlServer.Types.Unoffical package .

Otherwise, I think you should bring this up as support from Microsoft.

0


source


I found this to be a problem with both On-Premises TFS and VSTS.

Typically it looks like this in VS:

Visual studio folder tree

Even if it creates a folder in the bin directory locally, it is not on the build server.

The first thing to do is make sure the file is .dll

set to content and included in the original control (these are often excluded by default). This should mean they end up in the output directory. Since there are 32 and 64 bit DLLs with the same name, you cannot rely on which version does this in the actual bin folder, you must maintain the same folder structure.

After checking the dropdown build directory, you can invoke SqlServerTypes.Utilities.LoadNativeAssemblies()

with the correct relative path.

In one instance, I referenced them in a project that was not a published project (data access project) and the only way to get it to work is to add the NuGet package to the published top level web project.

0


source







All Articles