加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 为什么postharp会导致Web项目在发布时失败?

发布时间:2020-12-15 23:34:06 所属栏目:百科 来源:网络整理
导读:在postharp发布的4.2.27版本中,Web项目工作正常. 当postharp nuget包升级到 4.2.28发布失败.尝试在Microsoft.Web.Publishing.targets中运行TransformWebConfigCore时失败.错误 Microsoft.Web.Publishing.targets(1483,5): Error : Could not open Source fil
在postharp发布的4.2.27版本中,Web项目工作正常.

当postharp nuget包升级到> 4.2.28发布失败.尝试在Microsoft.Web.Publishing.targets中运行TransformWebConfigCore时失败.错误

Microsoft.Web.Publishing.targets(1483,5): Error : Could not open
Source file: Could not find file ‘[Project
Location]Web.config;web.config’.

解决方法

PostSharp 4.2.28自动将Web.config添加到内容MSBuild ItemGroup.这就是为什么在错误消息中看到web.config两次的原因:

Microsoft.Web.Publishing.targets(1483,5): Error : Could not open
Source file: Could not find file ‘[Project
Location]Web.config;web.config‘.

如果你的csproj包含这个元素:

<Content Include="Web.config" />

将内容更改为无:

<None Include="Web.config" />

发布Web项目后,请确保包含web.config文件.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读