在 AfterBuild 中使用 ResolveReferences 和 _CopyWebApplication 时未部署引用
当在独立的 MSBuild 项目 LocalPublish.xml 中使用时,以下 MSBuild 调用效果很好。
<MSBuild
Projects="MyProject.Web.csproj"
Targets="ResolveReferences;_CopyWebApplication"
Properties="WebProjectOutputDir=C:\Inetpub\MyProject\Website;OutDir=C:\Inetpub\MyProject\Website\bin\" />
过去,我们使用构建后事件命令行调用它: $(MSBuildBinPath)\msbuild "$(ProjectDir)LocalPublish.xml"
但是,我现在尝试将其集成到 MyProject.Web.csproj 的 AfterBuild 事件中,并且无法将引用的项目 DLL 复制到发布路径。我尝试按照建议将 BuildingProject=true 添加到 Properties 属性 这里 但它似乎没有什么区别。
The following MSBuild invocation works great when used in an independent MSBuild project, LocalPublish.xml.
<MSBuild
Projects="MyProject.Web.csproj"
Targets="ResolveReferences;_CopyWebApplication"
Properties="WebProjectOutputDir=C:\Inetpub\MyProject\Website;OutDir=C:\Inetpub\MyProject\Website\bin\" />
In the past, we have invoked it using a Post-build event command line:
$(MSBuildBinPath)\msbuild "$(ProjectDir)LocalPublish.xml"
However I'm now trying to integrate the same into the AfterBuild event of MyProject.Web.csproj, and it fails to copy referenced project DLLs into the bin folder of the publish path. I tried adding BuildingProject=true to the Properties attribute as suggested here but it does not seem to make a difference.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论