Th4t Guy
Th4t Guy

Reputation: 1492

ASP.NET dynamic compilation with multiple web servers

Infrastructure:

Issue:

Dynamic compilation occurs on each server, creating temporary asp.net files that have different names. Sometimes a postback will hit a different server than the previous request and I get a FileNotFoundException - Could not load file or assembly 'PageName.aspx.551d078a.agzxzct4. This file exists on the first server, but not the second.

Question:

How can I deploy my web forms website project to multiple web servers and allow each request to hit any server?

Ive tried:

Upvotes: 1

Views: 179

Answers (2)

Th4t Guy
Th4t Guy

Reputation: 1492

I had an enum defined inside the code behind file. I just moved it to a separate class file.

Upvotes: 0

Mohsin Mehmood
Mohsin Mehmood

Reputation: 4246

I believe you have an ASP.NET website (not web application) project. While publishing the website project you can turn on the setting for merging pages and control outputs into a single assembly instead of creating a separate dll for each page which is default setting.

In the screenshot, on the publish dialog settings tab you can click on Configure link next to Precompile during publishing option and set Advanced Precompile Settings

enter image description here

Upvotes: 0

Related Questions