The best VPN 2024

The Best VPS 2024

The Best C# Book

How to solve the System.Web.HttpException error when deploying mvc website on Jexus

How to solve the System.Web.HttpException error when deploying mvc website on Jexus? Jexus deploys the MVC website to report System.Web.HttpException error solution. During last year’s work, the author deployed the website developed by the ancient asp.net webform to the Linux server. The web server uses Jexus. When migrating the webform website to the Linux environment middle.

In the last post, I introduced how to deploy a website developed with asp.net webform technology to a Linux server. The web server uses Jexus. During the migration of the webform website to the Linux environment, I also got the author of Jexus Yu Nei Liu Yun’s help has solved many problems, and I sincerely thank the author for his enthusiastic help.

In the migration work last year, some websites were developed by asp.net mvc. At that time, the process of migrating the sites developed with mvc was relatively smooth, and there were no major problems; The library has been adjusted and upgraded. The website is published to the local directory as usual, and then uploaded to the website server through FileZilla. After opening the site, there is a System.Web.HttpException error, as shown in the following figure:

How to solve the System.Web.HttpException
How to solve the System.Web.HttpException

Jexus System.Web.HttpException error

wrong information:

Application Exception
System.Web.HttpException
The resource cannot be found.
Description: HTTP 404.The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Details: Requested URL: jhrs.com/vultr
Exception stack trace:
  at System.Web.StaticFileHandler.ProcessRequest (System.Web.HttpContext context) [0x000b9] in <a0cf28d1b51f4484bc8478653eeeba81>:0 
  at System.Web.DefaultHttpHandler.BeginProcessRequest (System.Web.HttpContext context, System.AsyncCallback callback, System.Object state) [0x0007f] in <a0cf28d1b51f4484bc8478653eeeba81>:0 
  at System.Web.HttpApplication+<Pipeline>d__225.MoveNext () [0x008d4] in <a0cf28d1b51f4484bc8478653eeeba81>:0 
  at System.Web.HttpApplication.Tick () [0x00000] in <a0cf28d1b51f4484bc8478653eeeba81>:0 
Version Information: 6.8.0.123 (tarball); ASP.NET Version: 4.0.30319.42000
Powered by Mono

Solve the System.Web.HttpException

Solve the System.Web.HttpException

Jexus deploys MVC website to report System.Web.HttpException error solution, first explain how this asp.net mvc site is deployed, the site is deployed on a similar Windows server, that is, adding a virtual directory in IIS, of course For the Linux environment, if it is not a website or project developed using .net core, that is, using the traditional asp.net webform, the website project developed by asp.net mvc is deployed under Linux, and the web server will use Jexus to act as it, so I A site configuration (just the beginning, not a complete configuration) is added to /usr/jexus/siteconf, as follows:

######################
# Web Site: Default 
########################################
port=80
root=/vultr /var/www/jhrs.com/vultr
hosts=jhrs.com

Solve the System.Web.HttpException

Then the address corresponding to the visitor visiting this site is: https://jhrs.com/vultr

After explaining the above preconditions, let’s talk about how the author troubleshoots the error. The specific troubleshooting steps are as follows:

In the development environment, running this MVC site directly in VS works fine.
Copy the published files of the vultr site directly to the main site directory (that is, the jhrs.com site directory), and it can also be accessed at this time, but because it is a sub site, it is impossible to occupy the main site domain name, which basically shows that the program is fine.

Check the MVC code carefully. When some entry code checks are completed, such as the code inspection in the App_Start directory, no problems are found.

When I was about to get off work for nearly a day, I suddenly remembered that it might be a problem with the release configuration, and it was confirmed.

How to solve the System.Web.HttpException
How to solve the System.Web.HttpException

So let’s talk about the conclusion directly. The reason for this error is that the option to precompile during publishing is checked in the file publishing option. It is very simple to know the reason. It is enough to republish without checking it. Then upload it to the server and it’s OK.

How to solve the System.Web.HttpException
How to solve the System.Web.HttpException

Regarding the introduction of precompiling Microsoft’s official website has instructions, and you can also search for the corresponding article introduction on the Internet.

After re-publishing and uploading, open the site again to check, everything suddenly became so beautiful, this is a pit that has been tossed for nearly a day today, hereby record it to provide a quick solution for later people.

Finally, let me repeat the main points. When you deploy the website to Jexus, if there is a System.Web.HttpException error, you may wish to check how you published the website.

How to solve the System.Web.HttpException error when deploying mvc website on Jexus Reference: https://jhrs.com/2022/44934.html

Leave a Comment