The deployment of the original Web service was not accessible and could not be debugged after the operating system was installed
"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 (. NET Framework Beta1), Windows XP 2.0
"Problem resolution process"
Because the original project has been using the tool Vs.net 2003, so although vs.net the beta has been out for a long time, but did not have a minute to savor, now the project is over, finally have the opportunity.
After reinstalling the system, all the tools are installed, the original Web service source code is copied directly to the C:\Inetpub\wwwroot directory, created as a virtual directory in Internet Information Services (IIS), and then used VS. NET2003 Open the deployment, the habitual (CTRL+F5) began to run, all normal, and then try to call one of the methods, but always the following error:
System.TypeInitializationException:The type initializer for ' System.Transactions.Diagnostics.DiagnosticTrace ' threw An exception. ---> System.UnauthorizedAccessException:The source is not found, but some or all event logs could the not is 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.DiagnosticTrace. Cctor ()
---End of inner exception stack trace---
At System.Transactions.Diagnostics.DiagnosticTrace.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.ExecuteDataset (CommandType CommandType, 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 ()
A look at the "System.TypeInitializationException:" and "security" word, you know it is a safety issue, but in the end what is the problem? I confused: Is it a question of procedure? Is this a problem with Windows SP2? Is that a matter of privilege? Wait, wait. Then want to pass F5 to debug to see, the result pops up the following warning box:
You did see "Do not enable Integrated Windows Authentication", initially identified as a permissions issue, click Help, Access to the MSDN address page below
Error: Debug failed because integrated Windows authentication is not enabled
Stepping into a Web application or XML Web services failed because integrated Windows authentication is not enabled. Therefore, the user who requires debugging cannot be authenticated.
Enable Integrated Windows authentication
1. Log on to the WEB server with an administrator account.
2. From the Start menu, open the Administrative Tools Control Panel.
3. In the Administrative Tools window, double-click Internet Information Services.
4. In the Internet Information Services window, use the tree control to open the node named for the Web server.
5. The Web site folder appears under 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 Sites folder and choose Properties from the shortcut menu. To configure authentication for individual Web sites, open the Web Sites folder, right-click an individual Web site, and choose Properties from the shortcut menu.
7. In the Properties dialog box, select the Directory Security tab.
8. In the Anonymous access and Authentication section, click the Edit button.
9. Under authorized access in the Authentication Methods dialog box, select Integrated Windows authentication.
10. Click OK to close the Authentication Methods dialog box.
11. Click OK to close the Properties dialog box.
12. Close the Internet Information Services window.
With the above steps, I hook up Integrated Windows authentication, as shown in the following figure:
Press F5 again, thinking that I must be allowed to debug it, the result of a jump out of a dialog box:
Error: Unable to start debugging on the WEB server
Please see
debugging scripts and the Web: errors and troubleshooting
When you try to debug an application running on a WEB server, you may sometimes 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 issues:
What to check
WEB applications on a remote server
Web applications stored in Visual SourceSafe and using the FrontPage server Extensions
Manually Attach
...
This is even more Meng, completely do not know where the problem is, do not allow me to debug! The old way, deploy a look, I then (CTRL+F5) again, call a method, the result still appears the original error system.typeinitializationexception:
Because the program has been debugged before, so it should not be the problem of the program, that will be the version of the problem, 1.1 and 2.0 of the conflict? I checked the settings in IIS carefully and found the next one:
The default ASP.net version is found in version 2.0, which means that IIS chooses the high version of the Framework by default, and I choose 1.1.4322.0, then click "OK", then F5 Debug, this success, then call method, all through!
"Problem extension"
The problem was solved, and turned back, why would it appear
System.TypeInitializationException:The type initializer for ' System.Transactions.Diagnostics.DiagnosticTrace ' threw An exception. ---> System.UnauthorizedAccessException:The source is not found, but some or all event logs could the not is searched. Inaccessible logs:security.
's mistake? How do I find out the version problem with the MSDN tips?
View MSDN:
System.TypeInitializationException: An exception that is thrown as a wrapper around an exception thrown by a class initializer. This class cannot be inherited.
System.UnauthorizedAccessException: The exception that is thrown when the operating system denies access because of an I/O error or a specified type of security error.
Just through this information, we are not sure, so I Google the "system.unauthorizedaccessexception"
This post discusses a deployment webservice related issue that is related to permissions, but it has nothing to do with the problem I found
It seems that there are many kinds of problems that arise in system.unauthorizedaccessexception, and the only explanation in this question is:
There is a permission level between. NET Framework1.1 and. NET Framework2.0, which is relatively 2.0 more privileged, and 1.1 of the program does not normally invoke the 2.0 component.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.