在 AfterBuild 中使用 ResolveReferences 和 _CopyWebApplication 时未部署引用

发布于 2024-10-09 07:48:43 字数 707 浏览 0 评论 0原文

当在独立的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文