Will
Will

Reputation: 10431

C# Reference any version?

Is it possible to not reference a specific but instead reference any version with C#? Or am I stuck setting up a PostBuild script that strips the specific version?

The reference is to another project in the same solution.

Upvotes: 0

Views: 2491

Answers (3)

Marino Šimić
Marino Šimić

Reputation: 7342

Can assembly bindingRedirect help you somehow?

http://msdn.microsoft.com/en-us/library/2fc472t2(v=vs.80).aspx

Upvotes: 1

Danny Varod
Danny Varod

Reputation: 18068

If you mean a version of an assembly, then yes.

There are 2 ways to do this:

  1. Stand on reference, look in property window (F4 to jump there), find "Specific Version" and change it to false.

  2. Open up the .csproj file of the assembly that references the other assemly with a text or xml editor, search file for the name of the referenced assembly and remove the version number from the file.

Upvotes: 0

vcsjones
vcsjones

Reputation: 141648

Assuming you are talking about assembly versions, In Visual Studio you can right click an assembly reference, click "Properties", and change "Specific Version" to "false".

Upvotes: 5

Related Questions