简体   繁体   中英

Refer .net reference without specific version number

I am referring a 3rd party dll as refrence in my windows project. Whenever third party releases the dll I used to refer the latest one in code.. Post that I build and deploy the code.

Can't I somehow refer the dll without version and simply deploy the dll in production without building ?

Needless to say this would be tested first with just replacing the dll in non-prod.

Suggest if any mechanism exists.

Can't I somehow refer the dll without version and simply deploy the dll in production without building ?

You should be able to do this by adding a <dependentAssembly> element to your App.config . Please refer to the documenation for more information and details.

From MSDN:

You can manually edit the app configuration file to resolve assembly issues. For example, if a vendor might release a newer version of an assembly that your app uses without supplying a publisher policy, because they do not guarantee backward compatibility, you can direct your app to use the newer version of the assembly by putting assembly binding information in your app's configuration file as follows

<dependentAssembly>
    <assemblyIdentity name="someAssembly"  
    publicKeyToken="32ab4ba45e0a69a1"  
    culture="en-us" />
    <bindingRedirect oldVersion="7.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>  

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