[英]In Visual Studio, how do I efficiently work with NuGet package source code
I have an application that references a NuGet package X. The source for X is under my control, ie, I manage the source and publish the artifact to a private NuGet repo. 我有一个引用NuGet包X的应用程序.X的源代码在我的控制之下,即我管理源代码并将工件发布到私有NuGet仓库。
I want to be able to be able to edit the source for X and have my application use assemblies built from that source instead the using the assemblies in the X's NuGet package. 我希望能够编辑X的源代码并让我的应用程序使用从该源代码构建的程序集,而不是使用X的NuGet包中的程序集。
Here was my workflow for this use case when I worked in Java/Eclipse: 以下是我在Java / Eclipse中工作时此工具的工作流程:
Can Visual studio do anything like that? Visual Studio可以做那样的事吗?
The only way to do this is to manually remove the reference to the nuget package X form your solution then add reference to the project X. The version number doesn't matter when you include a source project into your solution. 执行此操作的唯一方法是从您的解决方案中手动删除对nuget包X的引用,然后添加对项目X的引用。当您将源项目包含到解决方案中时,版本号无关紧要。 Visual studio will automatically build the project X whenever a code change is made after the last dll was generated and you will be able to debug it as part of your solution. 每当在生成最后一个dll之后进行代码更改时,Visual Studio将自动构建项目X,并且您将能够将其作为解决方案的一部分进行调试。 When you are finished with your changes, you can push the library into the private nuget server as a " pre-release " to signal it is still in testing phase. 完成更改后,您可以将库推送到私有nuget服务器作为“ 预发布 ”,以表示它仍处于测试阶段。 In Nuget manager inside visual studio you will have to check the option "include prerelease" to see it. 在视觉工作室内的Nuget经理中,你必须检查选项“include prerelease”才能看到它。
Edit: There is a dotnet command line tool that handles switching between project/nuget package and update all references automatically. 编辑:有一个dotnet命令行工具 ,可以处理project / nuget包之间的切换并自动更新所有引用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.