While publishing a project, classes in AppCode folder did not complied

1.3k Views Asked by At

I want to publish a mvc web project on visual studio IDE. In the project, here is one class in the AppCode folder. But after publish / build the project, there is no .dll file for this folder. As a result, the folder did not compile.

I clicked Publish and selected Configuration is release as a settings of publish. I build all solution files more than one time.

I expected .dll file for AppCode classes but after publishing AppCode folder created and it includes .cs file. As a result there is no dll file for this folder.

2

There are 2 best solutions below

3
Brando Zhang On

If you want to complie the AppCode classes, I suggest you could try to follow below steps:

1) Right click on your class file in App_Code folder.

2) Click on properties.

3) Change Build Action to Compile

4) Build your App.

enter image description here

Then it will build into your project.dll, since asp.net will combine all the codes into one dll.

Like below:

The Te is the App_Code class name.

enter image description here

0
Mert Metin On

I solved my problem with Publish settings. On File Options part, I checked "Precomplied during publish" option.

Then I saw that App_Code folder complied.