有没有更简单的方法来更新 dll 的新版本?
我有这种情况
- MySolution
- 图书馆
- SomeLibrary.2.0.1
- 我的项目1
- 参考 SomeLibrary.2.0.1
- 我的项目2
- 参考 SomeLibrary.2.0.1
- 我的项目3
- 我的项目4
- 参考 SomeLibrary.2.0.1
- 图书馆
现在,我正在将该库的版本更新到3.0。
一种方法是更新每个项目中的 dll。或者我可以编写一些脚本来将所有项目文件更新到较新的版本。
还有其他方法可以在解决方案中批量更新 dll 吗?
I have this situation
- MySolution
- Libraries
- SomeLibrary.2.0.1
- MyProject1
- Refer SomeLibrary.2.0.1
- MyProject2
- Refer SomeLibrary.2.0.1
- MyProject3
- MyProject4
- Refer SomeLibrary.2.0.1
- Libraries
Now, I am updating the version of this library to 3.0.
One way to do it would be to update the dll in each of the project. Or I can write some script which will update the all project files to the newer version.
Is there any other way to mass update the dll in a solution ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您没有将 UseSpecificVersion 设置为 true 的引用,则只需用新库替换该库即可。重建解决方案后,您的项目将引用新库。如果库名称不包含版本号(即您的库名为 SomeLibrary.dll),这将起作用。
如果库名称不同,那么一个简单的解决方案是在文本编辑器中打开所有 *.csproj 文件并执行搜索和替换。
If you don't have the references with the UseSpecificVersion set to true, it's enough to replace the library with the new one. After rebuilding the solution, your projects will reference the new library. This will work if the library name does not include the version number (i.e. your library is called SomeLibrary.dll)
If the library name is different, then a easy solution is to just open all *.csproj files in a text editor and perform a search and replace.
当您引用 SomeLibrary 时,您可以从
项目选项卡。但首先您需要所有项目都在一个解决方案下。
When you doing refference to the SomeLibrary , you can added it from
Project tab. But first you need that all projects will be under one solution.
我总是在解决方案文件夹中添加“lib”文件夹,在其中放置所有外部库以供引用。然后,当我更新“lib”文件夹中的库时,所有引用都会自动更新。
I'm always add "lib" folder in a solution folder where I put all external libraries to reference. Then when I will update library in "lib" folder all references will be automatically updated.