Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to start debugging on the web server. Access is denied.

Status
Not open for further replies.

ggeorgiou01

Programmer
Apr 11, 2005
60
GB
Hi All,

I have a problem.

When i try to debug one/any of my c# projects on web server, i receive the following message.

"Error while trying to run project: Unable to start debugging on the web server. Access is denied."

I have browsed multiple forums and articles, and they all state the same thing (web.config file - is not well formed).

I have double checked my web.config file, and all seems ok.

Does anybody have the same problem ? Does anybody know how to solve this iratating problem ?
 
Yes - The aspnet is assigned to the admin group, both on my client & server
 
Thanks for your reply dvannoy.

Yes - Intergrated Windows Authentication has been checked on iis !

I have never experienced this problem before, any more ideas ?
 
Did this just start happening? If so then maybe the debugger is still attached from a previous session (I believe that only one debugger can be attached at a time on the server) - although I don't think that would be the issue here.
 
I have been able to debug my project on the server before. This problem has only just started to occur.

Anybody else experiencing this problem ?
 
I just started a new job and had the same problem on my local machine, however, Windows Authentication was not checked in IIS and checking it solved my problem. Not sure about it for you though since you said that you checked this already.
 
Thanks for replying jshurst,

Thats not my problem though, windows authentication in IIS is already checked.

-g-
 
Are you a member of the debuggerusers group? I know you said that you were in an admin role, which I would think would override that, but you might want to check it out.
 
I often had this similar problem after I had switched a settings in the web.config file for a project, such as toggling debug= true or false or changing the configuration manager to debug or release.

What I tried and it worked was to shut down the IIS Server and then also click on the default web site and select refresh.

All I can say is that it worked for me when all else failed. Just like you I had every setting correct. This is VS.NET 2003.
 
On deeper inspection I found out that my real problem had been the fact I had switched my IIS from 1.1 to 2.0 in the property settings. This in turn modifies the web.config file in the inetpub/ folder. When I made this switch to 2.0, the web.config file was changed and I immediately could not debug on the server.

What I am getting at is that your web.config in the may be corrupt or not formed properly or just not have the right settings. I commented out the line that was causing a problem.

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- <configuration xmlns="[URL unfurl="true"]http://schemas.microsoft.com/.NetConfiguration/v2.0">[/URL] -->
<configuration>
    <system.web>
        <compilation defaultLanguage="c#" />
    </system.web>
</configuration>
 
Thank you for all your posts... here is a copy of my WEB.CONFIG file. Can anybody see anything wrong with it. Looks ok to me !

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="enterpriselibrary.configurationSettings" type="Microsoft.Practices.EnterpriseLibrary.Configuration.ConfigurationManagerSectionHandler, Microsoft.Practices.EnterpriseLibrary.Configuration, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</configSections>
<appSettings>
<add key="ApplicationPath" value=" />
</appSettings>
<system.web>
<!-- DYNAMIC DEBUG COMPILATION
Set compilation debug="true" to enable ASPX debugging. Otherwise, setting this value to
false will improve runtime performance of this application.
Set compilation debug="true" to insert debugging symbols (.pdb information)
into the compiled page. Because this creates a larger file that executes
more slowly, you should set this value to true only when debugging and to
false at all other times. For more information, refer to the documentation about
debugging ASP.NET files.
-->
<compilation defaultLanguage="c#" debug="true" />


<!-- CUSTOM ERROR MESSAGES
Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
Add <error> tags for each of the errors you want to handle.

"On" Always display custom (friendly) messages.
"Off" Always display detailed ASP.NET error information.
"RemoteOnly" Display custom (friendly) messages only to users not running
on the local Web server. This setting is recommended for security purposes, so
that you do not display application detail information to remote clients.
-->
<customErrors mode="Off"></customErrors>
<!-- AUTHENTICATION
This section sets the authentication policies of the application. Possible modes are "Windows",
"Forms", "Passport" and "None"

"None" No authentication is performed.
"Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to
its settings for the application. Anonymous access must be disabled in IIS.
"Forms" You provide a custom form (Web page) for users to enter their credentials, and then
you authenticate them in your application. A user credential token is stored in a cookie.
"Passport" Authentication is performed via a centralized authentication service provided
by Microsoft that offers a single logon and core profile services for member sites.
-->
<authentication mode="Forms">
<forms loginUrl="Login.aspx" name="AuthCookie" timeout="60" path="/" protection="All"/>
</authentication>
<!-- AUTHORIZATION
This section sets the authorization policies of the application. You can allow or deny access
to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous
(unauthenticated) users.
-->
<authorization>
<allow users="*" />
<!-- Allow all users -->
<!-- <allow users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
<deny users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
-->
</authorization>
<!-- APPLICATION-LEVEL TRACE LOGGING
Application-level tracing enables trace log output for every page within an application.
Set trace enabled="true" to enable application trace logging. If pageOutput="true", the
trace information will be displayed at the bottom of each page. Otherwise, you can view the
application trace log by browsing the "trace.axd" page from your web application
root.
-->
<trace
enabled="false"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="true"
/>
<!-- SESSION STATE SETTINGS
By default ASP.NET uses cookies to identify which requests belong to a particular session.
If cookies are not available, a session can be tracked by adding a session identifier to the URL.
To disable cookies, set sessionState cookieless="true".
-->
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
<!-- GLOBALIZATION
This section sets the globalization settings of the application.
-->
<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-GB" uiCulture="en-GB" />
</system.web>
<enterpriselibrary.configurationSettings xmlns:xsd=" xmlns:xsi=" applicationName="WASP" xmlns=" <configurationSections>
<configurationSection name="ApplicationConfiguration" encrypt="false">
<storageProvider xsi:type="XmlFileStorageProviderData" name="XML File Storage Provider" path="ApplicationConfiguration.config" />
<dataTransformer xsi:type="XmlSerializerTransformerData" name="Xml Serializer Transformer">
<includeTypes />
</dataTransformer>
</configurationSection>
<configurationSection xsi:type="ReadOnlyConfigurationSectionData" name="dataConfiguration" encrypt="false">
<storageProvider xsi:type="XmlFileStorageProviderData" name="XML File Storage Provider" path="DataConfiguration.config" />
<dataTransformer xsi:type="XmlSerializerTransformerData" name="Xml Serializer Transformer">
<includeTypes />
</dataTransformer>
</configurationSection>
<configurationSection xsi:type="ReadOnlyConfigurationSectionData" name="loggingConfiguration" encrypt="false">
<storageProvider xsi:type="XmlFileStorageProviderData" name="XML File Storage Provider" path="LoggingConfiguration.config" />
<dataTransformer xsi:type="XmlSerializerTransformerData" name="Xml Serializer Transformer">
<includeTypes />
</dataTransformer>
</configurationSection>
<configurationSection xsi:type="ReadOnlyConfigurationSectionData" name="loggingDistributorConfiguration" encrypt="false">
<storageProvider xsi:type="XmlFileStorageProviderData" name="XML File Storage Provider" path="LoggingDistributorConfiguration.config" />
<dataTransformer xsi:type="XmlSerializerTransformerData" name="Xml Serializer Transformer">
<includeTypes />
</dataTransformer>
</configurationSection>
</configurationSections>
<keyAlgorithmStorageProvider xsi:nil="true" />
<includeTypes />
</enterpriselibrary.configurationSettings>
</configuration>
 
dvannoy - I am running Windows 2k Server - With Service pack 4
 
I think SP4 may be your problem. there are tons of articles on this problem after installing or running sp4.

WORKAROUND
To work around this issue, assign the "Impersonate a client after authentication" user right to the ASPNET account in the Local Security Policy settings:1. Click Start, point to Programs, point to Administrative Tools, and then click Local Security Policy.
2. Double-click Local Policies, and then click User Rights Assignment.
3. In the right pane, double-click Impersonate a client after authentication.
4. In the Local Security Policy Setting dialog box, click Add.
5. In the Select Users or Group dialog box, click ASPNET, click Add, and then click OK.
6. Click OK.


 
Thank you for the reply dvannoy,

But this is not my problem either. I checked the workaround you suggested and my ASPNET user account was already assigned with the local security policy settings.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top