1
votes

How do I install Microsoft.SqlServer.Types assembly in GAC (C:\Windows\assembly\GAC_MSIL). It is missing.

I am getting error after running rdlc report. it is MVC based application-

Could not load file or assembly 'Microsoft.SqlServer.Types, Version=12.0.0.0, Culture=neutral, PublicKeyToken=token' or one of its dependencies.

It seems application is looking Microsoft.SqlServer.Types assembly in GAC. I know how to install using nuget in project folder but I want it in GAC.

1
You can use GacUtil.exe with the /i switch to install it to the GAC.Bradley Uffner
but why are you trying to add them to the GAC? what is it that you're actually trying to do, and why isn't a regular package reference (i.e. where the dll ends up in the output folder) a viable option for you?Marc Gravell♦
@MarcGravell Actually I don't have this assembly installed on my project but still I am able to run report as I have it on GAC. and my teammate is facing this issue and he doesn't have either on project folder or GAC. so wanted to get it installed on GAC. Is it possible that assembly got installed automatically in GAC due to sql server installed on my machine. my teammate is only have SQL client (SSMS studio) on his machine.SSD
You should avoid the GAC as much as you can exactly because it is inconsistent between machines. If you use Nuget package then the assembly will be available on any machine the solution is run/deployed on without depending on extra setup step.phuzi
@SSD yes, it is possible that the types are on some machines and not others, which is exactly why you shouldn't use the GAC here, and should just add the package reference from NuGet, here: nuget.org/packages/Microsoft.SqlServer.TypesMarc Gravell♦

1 Answers

3
votes