I'm very happy today, the project is finally online. It’s just that the problems encountered before going online were exhausting. . . But it was finally solved. . Let me tell you the problem here, hoping to provide some help to friends in need~~
Project: DOTNET project, C# development, the main function is to access the remote interface through COM components.
Operating environment: Windows 2003 Server + IIS6.0 + .Net 1.1
Problem: COM components and systems can be used normally under the WINDOWS2000 operating system, but after migrating to WIN2003, the process gets stuck when the program calls the components, and sometimes an error indicating that the server has encountered an unexpected situation will be returned~
Cause analysis: First of all, the component passed under other operating systems, indicating that there should be no problem with the component; the registration methods of COM components and DOTNET project reference are correct, but the error occurs in the step of calling the component, and the function of the COM component is to pass the IP address and port To access the remote interface, pay attention to the work of a remote network connection. Searching for similar issues on the Internet, most of the articles are about component permissions. I also set up the components according to the article, and the permissions of IIS access users, etc. are given to the maximum. Permissions, but the result still doesn’t work. . About to collapse. .
Solution: After being tortured by this problem for a few days, the company contacted Microsoft customer support, and Microsoft gave a way to check the security permissions of the application pool in IIS6.0. After checking, in the application pool properties in IIS, there is a default security account "Network Service" under the "Identity" tab, which is NetWork Service. Network Service is a built-in account in Windows Server 2003. It belongs to the IIS_WPG group. Members of IIS_WPG have appropriate NTFS permissions and necessary user permissions. According to the article on the Microsoft website, the Network Service account has processes that act as IIS 6 worker processes. Sufficient permissions to identify and have access to the network. But I don’t know why, the NetWork Service permissions here are not enough, so the component cannot be called to access the remote interface. The solution is to set the IIS_WPG account to read and execute, list folder directories, read, and NETWORK SERVICE requires full control permissions. According to the above method, I assigned the NetWork Service to the Administrator group ^_||, restarted IIS, and then ran the program. OK, and the component was called normally~~
So if any friends encounter that calling COM components cannot be used again, consider applying Permissions of the program pool~~
Refer to the following articles: http://www.microsoft.com/china/technet/community/columns/insider/iisi1203.mspx
http://flyskywlh.cnblogs.com/archive/2006/07/07 /445508.html