When VS publishes the website, an error message is reported: "Failed to copy file xxx to xxx, failed to find file xx" Three solutions!

When publishing a website, you may encounter such a situation, that is, an error message says: "Failed to copy file xxx to xxx, failed to find file xx", there are generally three solutions to this problem, and I personally prefer the third one. As shown in the figure:



The solution is as follows:

Option 1: Put the missing files prompted by the system into the corresponding folder, and then publish. But if you can't find the file for a long time, this solution is not recommended;

Option 2: Delete the corresponding parameter lines of <Content Include> in the ".csproj" project file, and use "ctrl+f" to find and delete them one by one. If there is a lot of content, this plan is not recommended. As shown in the figure:



Option 3: Right-click the corresponding folder where the error is reported, select "Exclude from project", and then click Publish. After the release is complete, copy the folder that was excluded from the project before to the folder after you release it. As shown in the figure:



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325996212&siteId=291194637