我在.Net Core2.0上。
我创建了一个新的解决方案,包括一个网络应用程序和一个网站。该网站项目包含一个index.html和web.config文件。
我没有问题发布网络应用,但网站给我带来了一些麻烦。
我添加了一个为FileSystem发布方法配置的发布配置文件。
在生成的默认.publishproj上运行dotnet发布时,将得到以下错误消息
error MSB4019: The imported project
"C:\ProgramFiles\dotnet\sdk\2.0.0\Microsoft\
VisualStudio\v10.5\Web\Microsoft.Web
Site.Publishing.targets" was not found. Confirm that the path in the
<Import> declaration is correct, and that the file exists on disk.好的,所以我将website.publishproj值更改为目标文件所在的位置。
<!--<Import
Project="$(_WebPublishTargetsPath)\Web\Microsoft.WebSite.Publishing.targets"
/>-->
<Import Project="C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\
Microsoft.WebSite.Publishing.targets" />然后我得到
error MSB3030: Could not copy the file
"C:\Users\Administrator\AppData\Local\Temp\WebSitePublish\WebSite2-
1026028577\obj\Debug\website.exe" because it was not found.
[C:\Users\Administrator\Documents\visual studio
2017\WebSites\WebSite2\website.publishproj]我可以在没有任何问题的情况下使用visual发布该网站。我遗漏了什么?
发布于 2017-09-18 17:57:09
看起来,您正在尝试使用dotnet CLI工具发布不受支持的“经典”网站项目。而是从developer命令提示符中使用msbuild。
https://stackoverflow.com/questions/46285423
复制相似问题