Web Application won't publish without .cs files

不想你离开。 提交于 2019-12-04 05:46:21

I just fixed this by deleting my old publish profile and creating a new one.

The new one appeared to have all the same settings as the old one but when I published it didn't copy the .cs files.

Edit: This answer is a lie. There was a difference between the two profiles. The new profile was in Release configuration.

Edit 2: There's a setting in the project settings which determines what gets published. Select "only files needed to run this application" from the following page.

Turns out that I added this line to my csproj file earlier when I was trying to get my project to build on our build server. Removing it fixed the problem:

<Target Name="GatherAllFilesToPublish"></Target>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!