简体   繁体   中英

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.

假设您正在谈论程序集版本,则可以在Visual Studio中右键单击程序集引用,单击“属性”,然后将“特定版本”更改为“假”。

Can assembly bindingRedirect help you somehow?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM