Wednesday, March 21, 2012

RS2005 breaks my build: Version 2.0 is not a compatible version

Hi,

We've developed a RS DataExtension on RS2000, including a reference to Microsoft.ReportingServices.Interfaces.dll. Since I have installed RS 2005 on my machine, (we actually saw this issue first on our build server) the project no longer compiles. We get this error:

fatal error CS0009: Metadata file 'c:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.ReportingServices.Interfaces.dll' could not be opened -- 'Version 2.0 is not a compatible version.'

The VS.NET 2003 project does include a '_references' directory, with the RS2000 version of the Microsoft.ReportingServices.Interfaces.dll (v8.0.1038.0) in it and the project file has a local reference like

<Reference
Name = "Microsoft.ReportingServices.Interfaces"
AssemblyName = "Microsoft.ReportingServices.Interfaces"
HintPath = "_references\Microsoft.ReportingServices.Interfaces.dll"
/>

So since installing RS 2005, it seems like the compiler is picking up the Microsoft.ReportingServices.Interfaces.dll from the GAC. On the build server (and confirmed by the installation on my dev box) RS 2005 installs this dll into the GAC. The compiler can only find this dll in the GAC, or is VS.NET doing tricky things here?

So my question is now, why ... ooooh why does the compiler pick up the wrong dll from the GAC and why ... ooooh why does it not pick up the explicit hintpath that is given in the project file.

Someone please tell me how to force the compiler to look at the correct dll/path.

If you want to build a data extension to be used with RS 2005, you have to use the .NET 2.0 C# compiler (or VS 2005) and your data extension has to reference the updated Microsoft.ReportingServices.Interfaces.dll that was installed by RS 2005.

The Interfaces.dll of RS 2005 is based on .NET 2.0 and cannot be used in a .NET 1.1 (VS 2003) project.

-- Robert

|||

Robert, yes, I understand that.

Indeed for the RS 2005 version of our Data Extension, we will use VS2005 and a reference to the RS 2005 version of the dll.

But, I'd still like to be able to compile the RS 2000 version of our Data Extension, using VS.NET 2003 and a reference to the RS 2000 version of the dll.

So problem is however that I have an existing data extension compiled against the RS 2000 version, which is being compiled using devenv (VS.NET 2003). This all worked until our sysadmin installed RS 2005 on the build server. Since RS 2005 has been installed, VS.NET 2003 always attempts to use the RS 2005 version of the dll's to compile the code, where as it should do as it states in the docs and use the RS 2000 version of the dll as specified in the references hintpath.

I have already build our data extension using csc (.NET v1.1) directly, which does seem to respect the references given to it. I suspect that the issue is more a VS.NET 2003 issue, resolving the dll reference incorrectly 1) from the GAC, 2) from the .NET 2.0 GAC, instead of taking the dll that has been copied in the project directory.

Rudi

|||

A new day, a new result.

Today the build on my machine does work.

I did install VS 2005 yesterday, maybe that 'magically' fixed the problem.

So we're installing VS 2005 on our build server aswell, hopefully that will solve the problem for us.

|||

Turned out that installing VS 2005 did NOT solve the problem.

The real solution exists in creating a *.csproj.user file with the ReferencePath set correctly. When running devenv from the command-line, it will pick up the *.csproj.user file and use the ReferencePath to locate the correct reference.

I was hoping to see (and test) the VS2003 SP1 this month, but this seems to be another 'longwait' program, it was first promised to be April 2006, then June 2006, but still not here: http://msdn.microsoft.com/vstudio/support/servicing/sp1_vs03/default.aspx

No comments:

Post a Comment