In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
ASP.NET website release need to pay attention to which holes, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
Development tool: VS2010,MVC4.0,SQLSERVER2008
Server: Windows server 2012, IIS8, SQL server 2012
First, after the release, the first opening of each page is very slow, 50 seconds or more, and the second opening will be very fast.
Estimated reason: slow compilation, but not so slow to release on machines with VS environment
Solution:
Use a higher version of VS, "pre-compile during release", and use IIS8's Application Initialization feature 1. Use VS2017 "precompile during release"
An error was encountered while publishing:
It is wrong to use sections registered as allowDefinition='MachineToApplication' outside the application level. This error may occur if the virtual directory is not configured as an application in IIS.
Workaround: comment the following code in web.config at release time
two。 Use the Application Initialization feature of IIS8
The solution to the slow access to ASP.NET website for the first time
II. Frequent loss of ASP.NET session
Problem: about 30 seconds after login, the session is lost and you need to log in again.
Solution: ASP.NET has several session state modes, which defaults to "InProc mode" and changes to "StateServer mode". The problem is solved.
1. Off mode
That is, close Session.
Session can be written in a section in the Web.Config file when the whole site is turned off:
To turn off Session on a page, add:
2. InProc mode (default mode)
If SessionState Mode is not configured in the Web.config file, the default is InProc mode.
If you want to customize the parameters of InProc mode, you need to write to the Web.config file, for example:
Whether the cookieless setting allows you to set the timeout, in minutes, without using Cookie,timeout.
InProc mode depends on the ASP.NET process, and when the IIS process crashes or restarts, the session state saved in the process is lost.
3. StateServer mode
StateServer mode stores session data in a separate memory buffer, which is controlled by a Windows service "ASP.NET State Service" (which needs to be opened in the windows service). You need to set stateConnectionString:
When using StateServer mode, all classes that need to be saved in Session need to be serializable:
[Serializable]
Public class SomeClass {}
The advantage of StateServer mode is that it is independent of the IIS process, and the restart of the IIS application does not affect the session data.
4. SQLServer mode
Use SQL Server to save Session, and even if IIS restarts, Session will not be lost. You need to create an ASPState database first. Specific methods can be found on the Internet.
After reading the above content, have you mastered the methods of the holes that need to be paid attention to when the ASP.NET website is released? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.