When VS.NET 2003 encounters VS.NET 2005WEBSERVICE deployment?
Author: He Galaxy (hxhbluestar)
Time: 2005-1-16
[Problem description]
After reinstalling the operating system, the original Web Service is unable to access and cannot be commissioned.
[Original programming environment]
VS.NET2003 (.NET Framework 1.1 SP1), Windows XP SP1
[New Programming Environment]
Vs.net2003 (.NET Framework 1.1 SP1), VS.NET 2005 Beta1 (.NET Framework 2.0), Windows XP SP2
[Problem resolution process]
Because the original project has been using tools vs.net 2003, although vs.net 2005 beta has already come out for a long time, there is no time to taste, and now the project comes to a paragraph, and finally has the opportunity.
After reinstalling the system, all the tools are installed, and the original Web Service source code is copied directly to the C: / INETPUB / WWWROOT directory, and in the Internet Information Service (IIS) "is created as a virtual directory, then use VS. Net2003 opens deployment, habitual (Ctrl F5) starts running, everything is normal, then try to call one of the methods, but always appear wrong:
System.TypeInitializationException:
The Type Initializer for 'System.Transactions.Diagnostics.Diagnostreatrace' Threw An Exception.
---> System.unauthorizedAccessException: The Source Was Not Found, But Some or All Event Logs Could Not Be Searched.
INACCESSIBLE LOGS: SECURITY.
At system.diagnostics.eventlog.findsourceRegistration (String Source, String Machinename, Boolean Readonly)
At system.diagnostics.eventlog.sourceexists (String Source, String Machinename)
At system.diagnostics.eventlog.sourceexists (String Source)
At system.transactions.diagnostics.diagnostrace..cctor ()
--- End of Inner Exception Stack TRACE ---
At system.transactions.diagnostics.diagnostrace.get_verbose ()
At system.transactions.transaction.get_current ()
At system.data.common.adp.getcurrentTransAction ()
At system.data.common.adp.getcurrentTransAction ()
At system.data.providerbase.dbconnectionpool.GetfromTransactedPool (Transaction & Transaction)
At system.data.providerbase.dbconnectionPool.getConnection (Object OwningObject)
At system.data.providerbase.dbconnectionFactory.GetConnection (DBConnectionBase OwningConnection) at system.data.providerbase.dbconnectionclosed.openConnection (DBConnectionBase OuterConnection)
at system.data.providerbase.dbconnectionbase.Open ()
at system.data.sqlclient.sqlconnection.open ()
At ezhi.dataaccess.dbhelper.dataaccessHelper.executedata, String CommandText, DataSet DSData, IDBDataParameter [] CommandParameters)
At ezhi.dataaccess.accessclass.mealmodule.restaurantAccess.getdata (RestaurantData DSData, Int32 [] IID)
At jollorealservice.ezhiservices.ezhiservice.Fillrestaurant ()
At jollorealservice.ezhiservices.ezhiservice..ctor ()
Sight, "System.TypeinitializationException:" and "Security" word, you know that it is a security issue, but where is the problem? I am a fog: Is it the problem of the program? Is Windows SP2 problem? Is it a problem with authority? Etc., etc. So I want to debug a look at F5. As a result, the following warning box is popped up:
I did see "I didn't have integrated Windows Authentication". It is initially determined that the permissions issue, click Help, enter the following address page of MSDN.
MS-help: //ms.vscc.2003/ms.msdnqtr.2003feb.2052/vsdebug/html/vxtbserrorDebuggingfailedbecauseintegratedWindowsAuthenticationInTenableD.htm
Error: Debug failed because the integrated Windows authentication is not enabled
Since the integrated Windows authentication is not enabled, single-step execution web application or XML Web Services failed. Therefore, users who require debugging cannot be authenticated.
Enable Integrated Windows Authentication
1. Log in to the web server with an administrator account.
2. Open the Administrative Tools Control Panel from the Start menu.
3. Double-click "Internet Information Service" in the Administrative Tools window.
4. In the Internet Information Services window, use the tree control to open nodes named by the web server.
5. The "Web Site" folder appears below the server name.
6. You can configure authentication for all Web sites or individual Web sites. To configure authentication for all web sites, right-click the "Web Site" folder and select "Properties" from the shortcut menu. To configure authentication for individual Web sites, open the Web Site folder, right-click individual Web sites and select Properties from the shortcut menu.
7. In the Properties dialog, select the Directory Security tab.
8. On the Anonymous Access and Authentication section, click the Edit button.
9. Under "Authorized Access" of the Authentication Method dialog box, select "Integrated Windows Authentication". 10. Click OK to close the Authentication Method dialog.
11. Click OK to close the Properties dialog.
12. Turn off the Internet Information Services window.
According to the above steps, I will hook "Integrated Windows Authentication", as shown below:
Press F5 again, you want to always allow me to debug it, and the result is a dialog box:
MS-help: //ms.vscc.2003/ms.msdnqtr.2003feb.2052/vsdebug/html/vxtbshttpservererrors.htm
Error: Unable to start debugging on the web server
See
Debug script and web: errors and troubleshooting
When trying to debug an application running on a web server, you may get a message with the following error message:
Unable to start debugging on the Web Server
If you encounter these errors, you need to consider the following questions:
To check the web application on the remote server in the remote server stores in Visual SourceSafe and use the FrontPage server extension web application manual additional
...
This is more done, I don't know where the problem is, I don't allow me to debug! Old way, deployment, I will come again, call a method again, and the result is still the original error System.TypeInitializationException:
Because the program is previously debugged, it should not be a problem with the program, will it be a version problem, 1.1 and 2.0 conflicts? I carefully check the settings in IIS and find that there is the following:
Found the default ASP.NET VERSION is a 2.0 version, that is, IIS selection high version of Framework, I will choose the version to 1.1.4322.0, then click "OK", then F5 debug, this success, then call Method, all pass!
[Problem extension]
The problem is solved, go back, why do you appear?
System.TypeInitializationException:
The Type Initializer for 'System.Transactions.Diagnostics.Diagnostreatrace' Threw An Exception.
---> System.unauthorizedAccessException: The Source Was Not Found, But Some or All Event Logs Could Not Be Searched.
INACCESSIBLE LOGS: SECURITY.
What about the mistake? How to identify the version problem with the MSDN prompt?
View MSDN:
System.TypeInitializationException: An exception that caused by the unusual surroundings caused by the initial value setting item. Unable to inherit this class.
System.unauthorizedAccessException: An exception caused when the operating system refuses to access the access from an I / O error or a type of security error.
Just pass this information, we can't be sure, so I google got "System.unauthorizedAccessException"
Find the following useful information:
One,
http://blog.9cbs.net/wwwsq/archive/2004/11/30/198945.aspx[ASP.NET]system.unauthorizedaccessException: Refuse to access.
two,
http://www.error-bank.com/microsoft.public.dotNet.framework.webservices/4131_thread.aspx
An issue of deploying WebService discussed by this post, but it has nothing to do with the privilege.
It seems that there is a lot of questions in System.unauthorizedAccessException, in this problem, the only explanation is:
There is a permission level between .NET Framework1.1 and .NET Framework 2.0, relatively 2.0 permissions, 1.1 procedures cannot correctly call 2.0 components
[Later]
The reason for this problem occurs in preliminary speculation is the interoperability issue between FRAMWORK, welcome to discuss.