I have a project developed in C# in Visual Studio 2008, NET Framework 3.5, SQL Server 2008 Standard with Reporting Service
I migrated to Visual Studio 2019, changed the target framework of all projects to net.framework 4.0, and changed SQL Server to 2014 Standard with reporting Service
However, I'm having a problem with some reports that use a custom dll that was previously compiled in framework 3.5 and is now compiled in framework 4.0 When trying to deploy it gave the following message:
Error message: "Severity Code Description Project File Line Suppression State Error Error loading code module: 'DALPersisteDados, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Details: Could not load file or assembly 'DALPersisteDados, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. 0"
I managed to work around the problem as follows:
In the Visual Studio report we reference the DLL compiled in the 4.0 framework I copied the DLL compiled in framework 4.0 to: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\SSRS
However, in the Reporting Service folder I left the DLL compiled in framework 3.5: C:\Program Files\Microsoft SQL Server\MSRS12.MSSQLSERVER\Reporting Services\ReportServer\bin
When I try to paste the 4.0 dll into the MSRS12.MSSQLSERVER\Reporting Services\ReportServer\bin folder, it returns the error message mentioned above
I checked the web.config of the C:\Program Files\Microsoft SQL Server\MSRS12.MSSQLSERVER\Reporting Services\ReportServer folder, the reportin service seems to be trying to use framework 3.5 and 2.0 I tried to change it manually but without success and I couldn't find anywhere how to make this change