1

I have reports in SSRS2008R2 which uses this code to return the report execution time in the local time zone of the client running the report:

=System.TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow,TimeZoneInfo.Utc.Id,First(Fields!TenantTimeZoneName.Value, "Company"))

In order for this to run in SSRS2008R2, I added the reference assembly below:

System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

These reports have run fine for years until now. I am building up a new SSRS2012 server and when I attempt to deploy a report to the new server, I get the following error during deployment:

The definition of the report '/MyReport' is invalid.

Assuming that this just meant that I would have to switch the reference assembly to point to a higher release System.Core, I changed the assembly to point to System.Core 4.0 instead of System.Core 3.5. When I do that, I get this error:

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

I checked the file location and the System.Core assembly shows up just where the path indicates it is supposed to be. I also checked the GAC and the assembly is there.

I really need to get this working ASAP but I am at an impasse. Any ideas?

Derrick Van Hoeter
  • 157
  • 2
  • 3
  • 10
  • [Here is a question](http://stackoverflow.com/questions/15260761/how-do-i-resolve-report-deployment-error-when-referencing-system-core-4-0-unde) where someone solved a similar problem. – Chris Latta Feb 02 '15 at 05:50

1 Answers1

0

This is old, but for anyone looking. It is best to remove the reference to System.Core and call the same function via system.

The example below converts a datetime from "UTC" to "EST".

=System.TimeZoneInfo.ConvertTimeBySystemTimeZoneId(Fields!YOURDATETIMEHERE.Value, "Dateline Standard Time", "Eastern Standard Time")
DanielBarbarian
  • 5,093
  • 12
  • 35
  • 44
Andy
  • 21
  • 4