Targetting 1.1 with VS2005

Topics: For MSBee Users
Aug 16, 2006 at 8:46 PM
migrated from power toy forums
originally posted by udibs
------------------------------------------------------

Hi,
I'd like to use VS2005 but to target my application to run on 1.1.

I tried adding to the csproj files the following line:

<Import Project="...\MSBuild\MSBee\MSBuildExtras.FX1_1.CSharp.targets" /> .

It worked fine with a simple demo application.

However, when I tried it on my real application the build failed and I got the error: "Metadata file 'C:\...Debug\Interop.CWUIControlsLib.dll' could not be opened -- 'Version 2.0 is not a compatible version.' "
(this is a third party dll.)

when targeting to 2.0 and not to 1.1 (without the above line) everything works fine.

what is the problem here?

Thanks!

Udi.
Aug 16, 2006 at 8:46 PM
originally posted by Craig Lichtenstein - MSFT
------------------------------------------------------

I see two possibilities.

1. If Interop.CWUIControlsLib.dll is a COM Reference, then it won't work with MSBee since MSBee doesn't support COM references yet; look for that in Beta 2 which is coming in 5 weeks.

2. This DLL was probably built with .NET 2.0 (hence, 'Version 2.0 is not a compatible version.'). Since the csc v1.1 compiler can't reference .NET 2.0 assemblies, that may also be causing the build failure.

If you think neither of these are the case, let me know.

-Craig
Aug 16, 2006 at 8:46 PM
originally posted by udibs
------------------------------------------------------

Thanks Craig!

Here is the thing -

The problem happens only if I compile my application with VS2005 and targeting to 1.1.

When copiling with VS2005 to 2.0 (without MSBee), or with VS2003 (in both cases with the same dll) everythjing works fine.

Anyway you are right, the DLL is a COM reference,

What do I do then? How do I work around it so I won't have to wait 5 weeks?

Thanks again,

Udi.
Aug 16, 2006 at 8:46 PM
originally posted by Josh Ledgard
------------------------------------------------------

Sorry, at this point there is not much you can do. This is why it's a pre 1.0 release at the moment. You hit upon a key limitation that we hope to solve with the beta 2 release.
Aug 16, 2006 at 8:46 PM
originally posted by Craig Lichtenstein - MSFT
------------------------------------------------------

Actually, there is one thing you can try. You can generate the interop DLL using VS 2003 and then add that DLL as an assembly reference in your 2005 project file. Thus, it would look something like:

<Reference Include="Interop.CWUIControlsLib">

<Name>Interop.CWUIControlsLib</Name>

<HintPath>Path to DLL\Interop.CWUIControlsLib.dll</HintPath>

</Reference>

Of course, you need to replace Path to DLL with the actual path
Aug 16, 2006 at 8:47 PM
originally posted by udibs
------------------------------------------------------

It works like a charm!

Thank you very very much!

Udi.
Aug 16, 2006 at 8:48 PM
originally posted by Craig Lichtenstein - MSFT
------------------------------------------------------

Note that with the Beta 2 release, you no longer need the above workaround since MSBee now includes COM reference support.