I solved the problem of multiple project sharing session today! ! !

zhaozj2021-02-16  61

I solved the problem of multiple project sharing session today! ! !

I was very annoyed by the different web projects of the same site. I was very uncomfortable. I was very uncomfortable. For many days, I was thinking about this problem. With my help, I found a solution, I also saw some related articles online. However, these articles are not enough detailed. I put these related knowledge, so that I will find it later, it is convenient to encounter such problems in the future, don't find information, patch up the information. First of all: 1. Different sites or virtual directories are unable to share session 2, and VS.NET created by default is a project a virtual directory 3. Multiple projects can only have a set of Web.config and Global .aSAX Due to the above reasons, we cannot share sessions when you create multiple projects, but create such a problem with the creation of VS.NET -> Other projects -> Enterprise-level template items will not have this problem. Solving this problem is not difficult, pay attention to two points, you can only have a set of web.config and global.asax to merge these projects into a virtual directory, as for Web.config and Global.asax Although a project can be configured, it is recommended or a set of configurations throughout the web site, and the web.config under different directories affects the configuration of the ASPX in different directories. If the root directory is Web, there is a web application directory .config files, and defined, sessionState mode = "inproc" obviously these two applications are impossible to share. 2, multiple virtual directory merge, or only one site, you can. The specific approach is that the directory of the sub-project is opened in the IIS settings View Properties -> Directory -> There is a delete button in the application settings, and the deletion will remove the virtual directory of this directory so that it is OK. The problem I encountered is that I have not noticed the second point. My approach is: Right-click on the Explorer -> Share -> Web Share -> and specify a name, then open with vs.net, you can open it, but you can't share the session. Nothing noted that IIS puts the sub-projects in it to virtual directory. When it turned out, VS.NET would set another project to a virtual directory, so Session could not share it. The only thing I did is to delete the virtual directory. I didn't sleep well for many days. I hope everyone should not learn me.

转载请注明原文地址:https://www.9cbs.com/read-17124.html

New Post(0)