Build Task VSBuild@1 not building .Net Framework 4 Web application (aspx) correctly

Viewed 114

I'm trying to configure ci/cd for an old project which uses .net framework 4 and is aspx pages web app. I'm using VSBuild@1 task to build it with following config:

enter image description here

It builds it correctly. But the problem is that it places the /App_GlobalResources on root level as well. Whereas when I publish it locally on my Visual Studio, it doesn't generate this folder at all. Hence when I try to deploy the artifact produced from VSBuild@1 task, it gives following error, and application won't start/run:

The directory '/App_GlobalResources/' is not allowed because the application is precompiled

If I remove this folder manually from deployed folder on server, the application works fine. But the newly added resources in .resx files are not compiled. i.e, they are not there at all, hence application will crash whenever trying to access such resource key.

Question: How can I fix this problem? The build task should produce such an artifact which should not include /App_GlobalResources folder in main level. And that resource files inside that should also be built.

(I have encountered this type of error for first time, may be I wasn't able to explain well, so any questions are welcome, I'll provide more details accordingly)

1 Answers
The directory '/App_GlobalResources/' is not allowed because the application is precompiled

Above error is a common problem caused by the precompiled site. You can try to delete the PrecompiledApp.config file and re-start your application.

Here is a case with similar issue you can refer to.

Related