vs2022升级旧项目并发布时:Microsoft.WebTools.Shared.Exceptions.WebToolsException: 生成失败
发布时间:2023/11/14 17:06:57 作者:Admin 阅读:989
广告:
日志提示:
System.AggregateException: 发生一个或多个错误。 ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: 生成失败。
错误提示:
无法发布-旧项目升级到vs2022发布时出现:该项目中不存在目标“GatherAllFilesToPublish”
一、添加引用:<Reference Include="Microsoft.CSharp" />
二、把 *.csproj 里面内容,换成:
<PropertyGroup> <AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects> </PropertyGroup>
换成:
<PropertyGroup> <AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> </PropertyGroup>
三、把 *.csproj 里面内容二行,中间加一行:
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
广告:
相关文章