12

I am trying to deploy a report to the server with a custom assembly for the first time. I am able to deploy the same report without the assembly. I am using Reporting Services 2012 (Visual Studio 2010) to deploy the report.

Here is the full error message I get when I try to deploy:

Error while loading code module: ‘SGA.Reporting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’. Details: Could not load file or assembly 'SGA.Reporting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

I have read several posts on this same issue, not of which have solved my problem. It's a dll compiled for .NET Framework 4.0, AnyCPU.

On my local PC where I'm deploying from I've copied my dll to all these folders: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies C:\Windows\Microsoft.NET\Framework\v4.0.30319 C:\Windows\Microsoft.NET\Framework64\v4.0.30319

On the server I'm deploying to I've copied my dll to these all these folders: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies C:\Windows\Microsoft.NET\Framework\v4.0.30319 C:\Windows\Microsoft.NET\Framework64\v4.0.30319

Any ideas?

Jeff Stock
  • 3,796
  • 12
  • 46
  • 61

3 Answers3

14

It turned out I needed to copy the dll to this folder on the report server: %ProgramFiles%\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer\bin

That is the only place it is needed on the report server if you just want to deploy reports to it.

Alex Nolasco
  • 18,750
  • 9
  • 86
  • 81
Jeff Stock
  • 3,796
  • 12
  • 46
  • 61
  • 2
    For future readers: Your value of "MSRS10_50.MSSQLSERVER" will vary. – granadaCoder Oct 15 '13 at 21:21
  • Here is an additional top... for the Visual Studio Designer. http://stackoverflow.com/questions/2653965/reporting-services-2005-deploying-error-could-not-load-file-or-assembly – granadaCoder Oct 15 '13 at 21:38
  • Hello, i experience the same problem, may i know where to copy the dll and where to paste? – rickyProgrammer Nov 30 '18 at 05:48
  • 1
    Fore reporting service 2016 the address can be something like this(when your instance iname is SQL2016) : c:\Program Files\Microsoft SQL Server\MSRS13.SQL2016\Reporting Services\ReportServer\bin – Mahmoud Moravej Dec 18 '18 at 12:00
3

I had similar problems. I only had it in the public assemblies. Once I added the dll to the private assemblies location it worked. Are you running VS as administrator?

Nate
  • 131
  • 1
  • 2
  • 7
1

Another solution is to deploy your assembly to GAC. You will need to "strong name" it to be able to deploy to GAC. When it is in GAC, you don't need to have it in Reporting Services\ReportServer\bin

demp
  • 12,665
  • 2
  • 23
  • 17
  • I tried this. It didn't work for me. However the solution provided above by @Jeff Stock worked fine. – ih303 Jun 26 '17 at 17:05