1. How to specify the IIS virtual directory (ApplicationProgram).
For IIS6, it is relatively simple. You can directly specify it on the attribute page. You can find the function of the specified version on iis7, but you cannot find it. It takes a lot of weeks to find out, iis7 specifies the version based on the application pool and is specified when a virtual directory is created.
2. Duplicate type name within an assembly
The operating environment of the program uses the castle 1.0rc framework. This error is inexplicable and has no clear instructions. It only prompts that an error occurred during the Nhibernate initialization type. The specific type does not have a clear prompt. I started to suspect that my class name was already repeated, but the compilation was successful. After careful check, I did not find any entity class with repeated names. I was puzzled, So I google it, we found many similar problems. Most people say it is Castle. dynamicproxy. DLL bug. Later this file was upgraded to Castle. dynamicproxy2.dll, while Castle 1.0rc3 I use is an old version and cannot be replaced directly.
Inspired by this information, the root cause of the problem was that nhib.pdf used Castle. dynamicproxy to generate the entity class, but the old version of Castle. dynamicproxy had problems working under ASP. NET 4.0.
It is easier to find the problem and solve it. Set the application pool back to Asp.net 2.0, and everything is OK.
It seems that this project can only work under Asp.net 2.0.
The risk of using open-source projects is still quite high. Due to the release of Asp.net MVC, the castle project has not been updated for a long time and may not be packaged and released in a centralized manner, because each template has released a new version separately, however, you need to test the compatibility by yourself. Therefore, it may take a long time to upgrade a project that has been running stably, and you don't want to worry about it. However, because you need to add new features constantly, this part of the function is limited, so Asp.net 4.0 cannot be used, and it is quite awkward.
If a project requires continuous development and expansion, or product-type projects, it is better to honestly use the basic official native technology, and the risks are controllable and will not be bound to other products. We recommend webform + ado.net.