lundi 18 septembre 2017

.Net Core Website publish Microsoft.WebSite.Publishing.targets

I am on .Net Core 2.0.

I create a new solution containing a webapp and a website. The website project contains an index.html and web.config file.

I have no issue publishing the web application, but the website causes me some trouble.

I added a publish profile configured for FileSystem publish method.

When I run dotnet publish on the default .publishproj generated, I get the following error message

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.

Ok, so I change the website.publishproj value to where the targets file is located.

<!--<Import 
Project="$(_WebPublishTargetsPath)\Web\Microsoft.WebSite.Publishing.targets" 
/>-->
<Import Project="C:\Program Files 
(x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\
Microsoft.WebSite.Publishing.targets" />

Then I get

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]

I can publish the website using visual studio without any issue. What am I missing?




Aucun commentaire:

Enregistrer un commentaire