Ignoring build number when referencing dll

Posted by brickner on Stack Overflow See other posts from Stack Overflow or by brickner
Published on 2010-06-04T15:55:57Z Indexed on 2010/06/06 20:12 UTC
Read the original article Hit count: 306

Filed under:
|
|
|
|

I have one solution with a .NET 4.0 project (C#) that produces a delayed signed dll, that I dotfuscate and sign.

EDIT: This is how I version the dll:

[assembly: AssemblyVersion("0.7.0.*")]
[assembly: AssemblyFileVersion("0.7.0.0")]

I have another solution with a .NET 4.0 project (C++/CLI) that references the signed dll and produces a signed dll (actually, delayed signed and signed in a post build because of a flaw in the C++ build system).

The problem is that the reference to the dll contains a specific version number, which includes even the build number (I want to have a build number).

Every time I build the referenced dll, I have to change the project settings file (.vcxproj) so it reference the new version dll. Since I work with source control, this is very inconvenient (different computers might have different build numbers since each computer build its own referenced dll - the referenced dll is not in the source control).

If I don't change the reference, I get a warning:

warning MSB3245: Could not resolve this reference. Could not locate the assembly...

And many errors like this:

error C3083: 'Foo': the symbol to the left of a '::' must be a type

These are resolved once I change the reference.

How do I make the reference ignore the build number or even the entire version number?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about visual-studio