我正在Visual Studio 2017中使用ASP.NET Core 2.0.
I am using ASP.NET Core 2.0 in VisualStudio2017.
当我在 IIS Express 中进行调试时,我的网站运行正常.但是,当将站点部署到IIS服务器时,并不会部署wwwroot中的所有文件夹和文件.我已经看过.csproj文件,但是我不知道如何确保它部署了所有文件和文件夹.
My site works fine when I hit debug in IIS Express. But when deploying the site to IIS server, not all the folders and files in wwwroot are deployed. I have looked at the .csproj file, but I don't know how to make sure it deploys all files and folders.
推荐答案我解决了这个问题.解决方案是编辑.csproj文件.
I solved the issue. The solution is to edit the .csproj file.
删除所有与wwwroot相关的 ItemGroup 标记,然后添加以下标记:
Remove all the ItemGroup tags related to wwwroot and then add this one:
<ItemGroup> <None Include="wwwroot\*" /> </ItemGroup>星号将包含所有子文件夹和文件.
The asterisk will include all the subfolders and files.
更多推荐
"wwwroot"中的某些文件文件夹未在ASP.NET Core Web部署中发布
发布评论