【发布时间】:2017-04-24 06:18:10
【问题描述】:
我的解决方案中的一些私有 Nuget 包在 Debug 中被它们的本地 dll 引用,并在 Release 中被引用为 nuget 包。
这是我的 Web.csproj:
<Choose>
<When Condition="'$(Configuration)' == 'Release'">
<Reference Include="CustomPackage, Version=1.0.0.0, Culture=neutral">
<HintPath>..\packages\CustomPackage.1.0.0\lib\net461\CustomPackage.dll</HintPath>
<Private>True</Private>
</Reference>
</When>
<Otherwise>
<Reference Include="CustomPackage, Version=1.0.0.0, Culture=neutral">
<HintPath >..\..\CustomPackage\bin\$(Configuration)\CustomPackage.dll</HintPath>
<Private>True</Private>
</Reference>
</Otherwise>
</Choose>
在 CustomPackage 发布并更新为 1.0.1 后,我会在 Nuget 包管理器中为我的解决方案更新该包。
问题: 然后,Nuget 将完全删除第一个引用,并在更新期间将更新后的引用置于条件之外。
我找到了Nuget Reference Switcher,我认为这是我的解决方案,它希望您将本地引用的所有项目添加到不适用于我的团队的解决方案中,我们只需要引用 dll。 GitHub Issue 已提交给其他有同样问题的人。
除了这个条件还有其他方法吗?
我可以在构建期间使用Web.Debug.csproj 对我的Web.csproj 应用转换吗?
谢谢,亚历克斯
【问题讨论】:
标签: asp.net-mvc visual-studio nuget visual-studio-debugging csproj