VS2010错误:无法在web服务器上启动调试

时间:2022-09-03 20:03:34

I get error message "Unable to start debugging on the web server" in Visual Studio 2010. I clicked the Help button and followed the related suggestions without success.

我在Visual Studio 2010中收到“无法在web服务器上启动调试”的错误消息。我点击了帮助按钮,按照相关的建议去做,但是没有成功。

This happens with a newly created local ASP.Net project when modified to use IIS instead of Cassini (which works for debugging). It prompts to set debug="true" in the web.config and then immediately pops up the error. Nothing shows up in the Event Viewer.

这发生在新创建的本地ASP中。Net项目修改为使用IIS而不是Cassini(用于调试)。它提示在web中设置debug="true"。配置然后立即弹出错误。事件查看器中没有显示任何内容。

I am able to attach to w3wp to debug. It works but is not as convenient as F5.

我可以附加到w3wp进行调试。它可以工作,但是没有F5那么方便。

I also have a similar problem with VS2008 on the same PC. Debugging used to work for both.

我在同一台PC上也有类似的问题。调试过去对两者都适用。

I have re-registered Framework 4 (aspnet_regiis -i). I ran the VS2010 repair (this is the RTM version). I am running on a Windows Server 2008 R2 x64 box.

我重新注册了框架4 (aspnet_regiis -i)。我运行了VS2010修复(这是RTM版本)。我在一个Windows Server 2008 R2 x64盒子上运行。

I do have Resharper V5 installed.

我确实安装了Resharper V5。

There must be some configuration setting or registry value that survives the repair causing the problem.

必须有一些配置设置或注册表值在修复后仍然存在,从而导致问题。

I'd appreciate any ideas.

我欣赏有什么想法。

27 个解决方案

#1


14  

Disable the loopback check

禁用回路检查

(original microsoft page here)

(原微软这页)

To set the DisableLoopbackCheck registry key, follow these steps:

要设置DisableLoopbackCheck注册表键,请执行以下步骤:

Click Start, click Run, type regedit, and then click OK.

单击Start,单击Run,键入regedit,然后单击OK。

In Registry Editor, locate and then click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa

在注册表编辑器中,找到并单击以下注册表键:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ Control\Lsa

Right-click Lsa, point to New, and then click DWORD Value.

右键单击Lsa,指向New,然后单击DWORD值。

Type DisableLoopbackCheck, and then press ENTER.

键入DisableLoopbackCheck,然后按ENTER。

Right-click DisableLoopbackCheck, and then click Modify.

右键单击DisableLoopbackCheck,然后单击Modify。

In the Value data box, type 1, and then click OK.

在值数据框中,键入1,然后单击OK。

Quit Registry Editor, and then restart your computer.

退出注册表编辑器,然后重新启动计算机。

#2


12  

I got a new PC with Windows 7. I installed VS2010 and my development environment and hoped my F5 debug problem would be gone, but it still failed to start the debugger.

我买了一台装有Windows 7的新电脑。我安装了VS2010和我的开发环境,希望我的F5调试问题会消失,但它仍然没有启动调试器。

This was a good clue since it ruled out the install of software.

这是一个很好的线索,因为它排除了安装软件的可能性。

I finally traced it down to my HOSTS file. I had an entry for some of my local websites which I can access like "http://testsite.lcl" but the IP I had assigned was my machine's IP instead of using 127.0.0.1 so it looked like a remote server to VS2010. Changing back to 127.0.0.1 resolved the issue.

我终于找到了我的主机文件。我有一个本地网站的入口,我可以访问http://testsite。但是我分配的IP是我的机器的IP,而不是使用127.0.0.1,所以它看起来像是VS2010的远程服务器。更改回127.0.0.1解决了这个问题。

Thanks for everyone's help on this.

谢谢大家的帮助。

#3


10  

I had the same problem. How did I fixed it.

我也有同样的问题。我怎么修复的?

Go to IIS (in my case IIS 7 / Windows 7). Select your web site from the list, click on .NET Compilation in ASP.NET section. Select Open Feature. Check if your Debug is set to True. In my case it was False. Once I changed it to True - I have my debug back :)

到IIS(在我的例子中是iis7 / Windows 7)。从列表中选择你的网站,点击。net编译。净截面。选择打开功能。检查您的调试是否设置为True。就我而言,这是假的。一旦我将它更改为True—我将调试返回:)

#4


6  

These steps my differ depending on your version of Windows. I am using 7 with iis 7.

这些步骤我的不同取决于你的Windows版本。我正在使用7和iis 7。

Open IIS Manager, click on Application Pools and find the 2 ASP.NET v4.0 pools (One is called "ASP.NET v4.0" the other "ASP.NET v4.0 Classic". Chances are that first one is stopped. Do not start it yet, we need to investigate a bit more.

打开IIS管理器,点击应用程序池并找到两个ASP。NET v4.0池(其中一个称为“ASP”。NET v4.0“另一个”ASP。净v4.0经典”。很有可能第一个被阻止。现在还不开始,我们还需要进一步研究。

For the "ASP.NET v4.0" pool, check the name in the Identity Field. Is it ApplicationPoolIdentity? Remember the name.

“ASP。NET v4.0“池,检查标识字段中的名称。ApplicationPoolIdentity吗?记得这个名字。

Open Computer Management (right click on My Computer and select Manage). Expand Event Viewer, then Windows Logs. Click on Application and wait for the data to load. There should be an error with a source of User Profile Service with a message that starts with "Windows cannot log you on because your profile cannot be loaded. Check that you are connected to the network, and that your network is functioning correctly."

打开计算机管理(右键单击我的计算机并选择Manage)。展开事件查看器,然后是Windows日志。单击应用程序并等待数据加载。如果用户配置文件服务的源出现错误,其消息以“Windows无法登录您,因为您的配置文件无法加载”开头。检查你是否连接到网络,你的网络是否正常运行。

If you do find that, then you have the same problem as I did.

如果你找到了,你就会遇到和我一样的问题。

The Solution: Go back to IIS Manager and right click on "ASP.NET v4.0" and select Advanced Settings. Under Process Model, the first field is Identity. Change this from ApplicationPoolIdentity to NetworkService. Click OK.

解决方案:回到IIS管理器,右键单击“ASP”。并选择高级设置。在流程模型中,第一个字段是Identity。将其从应用程序poolidentity更改为NetworkService。单击OK。

Now start the pool if it did not restart automalically. Go back to your application and press F5 (start debug) and your application should work.

如果池没有自动重启,现在启动池。回到您的应用程序并按F5(开始调试),您的应用程序应该可以工作。

Please note that I have not figured out why this works, and this may be a security risk, but at least you will be able to do some work while you think about this.

请注意,我还没有弄明白为什么这是有效的,这可能是一个安全风险,但至少您可以在考虑这个问题时做一些工作。

#5


4  

I had this problem in Visual Studio 2012 when running a website I had created in Visual Studio 2010. I tried each of the following, which did not solve the problem, but still may have been required:

我在2012年的Visual Studio中遇到过这个问题,当时我在Visual Studio 2010中创建了一个网站。我尝试了以下的每一种,并没有解决问题,但可能仍然需要:

  1. Checked that the App Pool was targeted to the same framework as what was specified in the web.config

    检查应用程序池是否针对与web.config中指定的相同的框架

    <compilation defaultLanguage="c#" debug="true" targetFramework="4.0">
  2. Started the 64bit Remote Debugger: \Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Remote Debugger\x64\msvsmon.exe

    启动64位远程调试器:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Remote Debugger\x64\msvsmon.exe

  3. Set the DisableLoopbackCheck registry key and restarted Windows. MS Instructions here

    设置DisableLoopbackCheck注册表项并重新启动Windows。说明女士在这里

  4. Browsed the site locally (it came up just fine).

    在本地浏览该网站(结果还不错)。

  5. Finally I found the IIS setting that fixed the issue.

    最后我找到了解决问题的IIS设置。

    1. Go to IIS (7.5 in my case) and click on the relevant site in the Sites node.
    2. 转到IIS(在我的情况下是7.5)并单击site节点中的相关站点。
    3. Double click .NET Compilation in the ASP.NET section
    4. 在ASP中双击. net编译。净截面
    5. Under Behavior, set Debug to True.
    6. 在行为下,将Debug设置为True。
    7. Click Apply and run the site in Visual Studio.
    8. 单击Apply并在Visual Studio中运行站点。

#6


3  

You can firstly deploy your web application/site with your iis, then open your visual studio 2010. Then click "File"->open->website->Local IIS Site, then select your website/application. Then you will find that the debug may works. This method works for my case.

您可以先将web应用程序/站点部署到iis中,然后打开visual studio 2010。然后点击“File”->打开->网站->本地IIS网站,然后选择您的网站/应用程序。然后您将发现调试可能是有效的。这种方法适用于我的情况。

#7


3  

I had the same issue on Win7 and VS2010 (without ReSharper) and found that Skype listened on port 80. IIS listens to port 80 by default. This can occur when you set VS to debug an existing web application running in IIS instead of the built in ASP.NET debug web server.

我在Win7和VS2010(没有ReSharper)也有同样的问题,发现Skype在80端口上监听。IIS默认监听端口80。当您将VS设置为调试在IIS中运行的现有web应用程序而不是在ASP中构建的应用程序时,就会发生这种情况。网络调试web服务器。

I solved the issue by unchecking "Use ports 80 and 443 as alternatives for incoming connections." in Skype under Tools -> Options -> Connection, followed by a restart of Skype.

我解决了这个问题,取消了“使用端口80和443作为进入连接的替代”,在Skype的工具——>选项——>连接,然后重启Skype。

#8


2  

What worked for me was to go into IIS at the server level, click on ISAPI and CGI restrictions, I found that aspnet_isapi.dll for asp.net 4.0 was set to Not Allowed. I set it to allowed and debugging worked. The steps are:

我的工作是进入服务器级别的IIS,点击ISAPI和CGI限制,我发现aspnet_isapi。net 4.0的dll设置为不允许。我将它设置为允许并调试工作。的步骤是:

  1. Open IIS.
  2. 打开IIS。
  3. Click on the top level
  4. 单击顶部
  5. Select ISAPI and CGI Restrictions under IIS in the Features view
  6. 在“特性”视图中选择IIS下的ISAPI和CGI限制
  7. Examine the Descriptions and if ASP.NET v4[current version] has the Not Allowed Restriction, click on the "Allow" link in the Actions section of the dialog.
  8. 检查描述和if ASP。NET v4[当前版本]具有不允许的限制,单击对话框的Actions部分中的“允许”链接。

This change should take care of the problem. Note that I came up with this solution when I tried to run the web app withoug debugging and I came up with the following error:

这个变化应该能解决这个问题。请注意,当我尝试在不进行调试的情况下运行web应用程序时,我提出了这个解决方案,我发现了以下错误:

HTTP Error 404.2 - Not Found The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server.

HTTP错误404.2 -由于Web服务器上的ISAPI和CGI限制列表设置,您请求的页面没有找到,因此无法提供服务。

#9


1  

Another thing to try (this is what worked for me):

另一件值得尝试的事情(这对我很有效):

In IIS, click Application Pools > (Your Site) > Advanced Settings, and change "Enable 32-Bit Applications" to True.

在IIS中,单击应用程序池>(您的站点)>高级设置,并将“启用32位应用程序”更改为True。

#10


0  

I don't have a definite answer though these articles may have some helpful info:

我没有明确的答案,虽然这些文章可能有一些有用的信息:

Using Windbg to start with w3wp.exe This mentions windbg/cdb debuggers specifically, but this advice should work with Visual Studio talking to cdb (which is attached to w3wp).

使用Windbg启动w3wp。exe这特别提到了windbg/cdb调试器,但是这个建议应该适用于Visual Studio与cdb(附加到w3wp)的对话。

Remote debugging with Visual Studio The reason I mention remote debugging at all is that I had to use that a few times in the past to get Visual Studio to attach to w3wp.exe. W3wp.exe runs in a different session, so you can't directly attach a debugger to that.

远程调试和Visual Studio,我提到远程调试的原因是,我在过去必须使用几次,才能让Visual Studio附加到w3wp.exe。W3wp。exe在不同的会话中运行,因此不能直接将调试器附加到该会话中。

#11


0  

You have not mentioned what operating system you are using. But this might not be related to operating system. I am taking a guess here. If you are running on Windows 7, try running visual studio under Administrator previlages.

您还没有提到您正在使用的操作系统。但这可能与操作系统无关。我猜一下。如果您正在Windows 7上运行,请尝试在Administrator previlages下运行visual studio。

You can also try adding your user ID to the VS debugger users group. You can access user groups by reight clicking on computer name or my computer and selecting Manage. Under that you can find Users & Groups.

还可以尝试将用户ID添加到VS调试器用户组。您可以通过右键单击计算机名或我的计算机并选择Manage来访问用户组。在那你可以找到用户和组。

#12


0  

In IIS in the Directory Security TAB, if using SSL check "Ignore client certificate" if you are running it in your local PC.

在目录安全选项卡中的IIS中,如果使用SSL,如果在本地PC中运行,请检查“忽略客户端证书”。

#13


0  

I was getting this after a new install of Windows 7 that did not include IIS by default. After installing IIS, the default app pool was created to run under .NET 2.0. Though I was able to set the default App Pool to .net 4 from .net 2, I still got this error. I had to reinstall .net 4 in IIS to get it to work properly. That is, run C:\Windows\Microsoft.NET{FrameworkFolder}\v{FrameworkNumber}\aspnet_regiis -i

我是在安装了Windows 7之后才得到这个功能的,因为Windows 7默认不包括IIS。安装IIS之后,默认的应用程序池被创建为在。net 2.0下运行。虽然我可以从。net 2将默认的应用程序池设置为。net 4,但是我还是得到了这个错误。我必须在IIS中重新安装。net 4才能使它正常工作。也就是说,C:\Windows\Microsoft.运行净v { FrameworkNumber } { FrameworkFolder } \ \ aspnet_regiis -我

#14


0  

What worked for me was to edit the HOSTS file in the C:\Windows\System32\drivers\etc folder and set the loopback for the website name I'd setup.

为我工作的是编辑的主机文件C:\Windows\System32\drivers\etc文件夹并设置回送我设置的网站名称。

For example:
127.0.0.1 http://guyellisrocks.com/

例如:127.0.0.1 http://guyellisrocks.com/

#15


0  

I've had the same issue and in my case it happened because the AppPool identity was set to impersonate an AD user which had its password changed. Therefore the process could not start and the AppPool always stopped when trying to debug from VS.

我也遇到过同样的问题,在我的例子中,这是因为AppPool标识被设置为模拟一个修改了密码的广告用户。因此,进程无法启动,当尝试从VS调试时,AppPool总是停止。

After updating the password in the AppPool/Advanced Settings/Identity everything started running smoothly.

在更新AppPool/Advanced Settings/Identity中的密码之后,一切都开始平稳运行。

#16


0  

Check whether the msvsmon.exe (Visual studio Remote Debugging Monitor) file is existing in the below path: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x64

检查是否msvsmon。exe(Visual studio远程调试监视器)文件中存在如下路径:C:\Program Files (x86)\Microsoft Visual studio IDE 10.0 \ Common7 \ \ \ x64远程调试器

If the file does not persist on the above mentioned path,then you need to get it from any other machine which is having the same version of Visualstudio.

如果文件没有在上面提到的路径上持久存在,那么您需要从具有相同版本的Visualstudio的任何其他机器上获取它。

#17


0  

Having tried all of the solutions above, I was still having this issue. Other projects were debugging without issue, so I knew it had to be something to do with this particular application's configuration.

在尝试了以上所有的解决方案之后,我仍然有这个问题。其他项目在调试时没有出现问题,所以我知道这一定与这个特定应用程序的配置有关。

Mine is an MVC app running under IIS 8. The issue was with URL Rewriting.

我的是一个在iis8下运行的MVC应用程序。问题是URL重写。

I had a rule to enforce trailing slashes. All I had to do was disable it (which can be done in IIS directly, or via the web.config below - just set enabled="false")

我有一条规则强制执行斜杠。我所要做的就是禁用它(可以直接在IIS中完成,也可以通过web来完成)。下面的配置-只设置enabled="false")

 <rewrite>
        <rules>
            <rule name="AddTrailingSlashRule1" enabled="false" stopProcessing="true">
                <match url="(.*[^/])$" />
                <conditions>
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                </conditions>
                <action type="Redirect" url="{R:1}/" />
            </rule>
        </rules>
    </rewrite>

#18


0  

Unload project, right click "edit abc.csproj" You will see the configuration. If your project is mapped to use IIS Web Express url.

卸载项目,右键单击“编辑abc”。你会看到配置。如果您的项目被映射为使用IIS Web Express url。

<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>6270</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://matrimonyfree.in/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>

verify If you have started the web site in IIS http://matrimonyfree.in in this case

验证是否在IIS http://matrimonyfree中启动了web站点。在这种情况下

#19


0  

It may also be because of some special or illegal format in your config file i will suggest you to check for that first .

这也可能是因为您的配置文件中某些特殊或非法的格式,我建议您首先检查一下。

In my case i was getting an error because of that when i tried to browse my service from IIS it showed me the real error .

在我的例子中,我得到了一个错误,因为当我试图从IIS浏览我的服务时,它显示了真正的错误。

#20


0  

I tried every single solution put online to resolve this issue and nothing seems to work consistently.

为了解决这个问题,我尝试了网上的每一个解决方案,但似乎没有一个方案是始终有效的。

I eventually solved it in both 2010 and 2012 by tracking it down to the following missing file in the Debug Source Files setting

我最终在2010年和2012年解决了这个问题,通过跟踪到调试源文件设置中丢失的以下文件

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\src\mfc\

Solution > Properties > Debug Source Files >

解决方案>属性>调试源文件>

Check to ensure all the files are there then remove this entry and everything worked again.

检查以确保所有的文件在那里,然后删除这个条目和一切工作再次。

#21


0  

Did you change your bindings on your IIS website? If so, you need to go to your project properties, select the Web tab, and change the Project Url to match your binding. so where it says http:///yourwebsite change it to http:///yourwebsite

您是否更改了IIS网站上的绑定?如果需要,您需要转到项目属性,选择Web选项卡,并更改项目Url以匹配绑定。所以它说http:///yourwebsite就改成http:///yourwebsite

This worked for me.

这为我工作。

#22


0  

In my case it was the system.webServer > httpErrors > errorMode in the web.config that caused the problem.

在我看来,这是系统。webServer > httpErrors在web上的errorMode。引起问题的配置。

If you have errorMode="Custom" try this:

如果你有errorMode="Custom",试试这个:

<httpErrors errorMode="DetailedLocalOnly">

See this answer: https://*.com/a/15585629/631277 for variations and other ideas concerning URL rewriting

请参见以下答案:https://*.com/a/15585629/631277,了解有关URL重写的变化和其他想法

#23


0  

I had same issue with Visual Studio 2013. In my case I had removed the "Default Web Site" from IIS. To resolve the issue I created the default website again, set physical path to C:\inetpub\wwwroot and port to 80 (default port). After restarting the Visual Studio it worked perfectly. Hope it helps someone.

我对Visual Studio 2013也有同样的看法。在我的例子中,我已经从IIS中删除了“默认Web站点”。为了解决这个问题,我再次创建了默认的网站,将物理路径设置为C:\inetpub\wwwroot和port设置为80(默认端口)。在重新启动Visual Studio之后,它运行得非常好。希望它能帮助一些人。

#24


0  

VS2010错误:无法在web服务器上启动调试

Unable to start debugging on web server. the web server not configured correctly.

无法在web服务器上启动调试。web服务器配置不正确。

How to resolve this problem?

如何解决这个问题?

Step-1

步骤1

open Command Prompt (Run as administrator)

打开命令提示符(作为管理员运行)

Step-2

步骤2

C:\Windows\system32>cd..

C:\Windows\ system32系统> cd . .

C:\Windows>cd Microsoft.NET

cd C:\ Windows > Microsoft.NET

C:\Windows\Microsoft.NET>cd Framework

C:\Windows\Microsoft.净> cd框架

C:\Windows\Microsoft.NET\Framework>cd v4.0.30319

C:\Windows\Microsoft.净\ > cd v4.0.30319框架

C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis.exe -i

C:\Windows\ Microsoft.NET \ Framework \ v4.0.30319 > aspnet_regiis。exe -我

#25


-1  

Your solution file in visual studio is broken. It's a known issue when converting from a file-system website to an IIS website, and it has been carried over from 2008 to 2010. Not sure of the location for the bug report on ms's kb site, though.

visual studio中的解决方案文件被破坏。当从文件系统网站转换到IIS网站时,这是一个众所周知的问题,从2008年一直延续到2010年。但是不确定ms的kb站点上的错误报告的位置。

Remove the website from the solution file (right click the project name, click "remove"). Then right click the solution name, click "add existing web site". When the dialog to add a web site comes up, choose "from IIS" in the left-hand pane. Navigate to your application in IIS, select "use secure sockets layer" if necessary, and click "finish" (or whatever that button is labeled).

从解决方案文件中删除网站(右键单击项目名称,单击“删除”)。然后右键单击解决方案名称,单击“添加现有web站点”。当出现要添加web站点的对话框时,请在左侧窗格中选择“from IIS”。导航到IIS中的应用程序,如果需要,选择“使用安全套接字层”,然后单击“finish”(或任何标记的按钮)。

this will permanently fix the issue.

这将永久性地解决这个问题。

#26


-1  

Unable to start debugging on web server. the web server not configured correctly.

无法在web服务器上启动调试。web服务器配置不正确。

  1. How To Resolve This Problem?

    如何解决这个问题?

    Step-1

    步骤1

    open Command Prompt(Run as administrator)

    打开命令提示符(作为管理员运行)

    Step-2

    步骤2

    C:\Windows\system32>cd..

    C:\Windows\ system32系统> cd . .

    C:\Windows>cd Microsoft.NET

    cd C:\ Windows > Microsoft.NET

    C:\Windows\Microsoft.NET>cd Framework

    C:\Windows\Microsoft.净> cd框架

    C:\Windows\Microsoft.NET\Framework>cd v4.0.30319

    C:\Windows\Microsoft.净\ > cd v4.0.30319框架

    C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis.exe -i Microsoft (R) ASP.NET RegIIS version 4.0.30319.0 Administration utility to install and uninstall ASP.NET on the local machine. Copyright (C) Microsoft Corporation. All rights reserved. Start installing ASP.NET (4.0.30319.0). .................. Finished installing ASP.NET (4.0.30319.0).

    C:\Windows\ Microsoft.NET \ Framework \ v4.0.30319 > aspnet_regiis。exe -i Microsoft (R) ASP。NET RegIIS版本4.30319.0用于安装和卸载ASP的管理工具。NET在本地机器上。版权(C)微软公司。保留所有权利。开始安装ASP。净(4.0.30319.0)。..................完成安装ASP。净(4.0.30319.0)。

    C:\Windows\Microsoft.NET\Framework\v4.0.30319>

    C:\Windows\ Microsoft.NET \ Framework \ v4.0.30319 >

#27


-2  

One of the things to check is to make sure if IIS is up and running. Something as simple as that would resolve this issue sometimes.

要检查的事情之一是确保IIS是否已经启动并运行。像这样简单的事情有时会解决这个问题。

#1


14  

Disable the loopback check

禁用回路检查

(original microsoft page here)

(原微软这页)

To set the DisableLoopbackCheck registry key, follow these steps:

要设置DisableLoopbackCheck注册表键,请执行以下步骤:

Click Start, click Run, type regedit, and then click OK.

单击Start,单击Run,键入regedit,然后单击OK。

In Registry Editor, locate and then click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa

在注册表编辑器中,找到并单击以下注册表键:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ Control\Lsa

Right-click Lsa, point to New, and then click DWORD Value.

右键单击Lsa,指向New,然后单击DWORD值。

Type DisableLoopbackCheck, and then press ENTER.

键入DisableLoopbackCheck,然后按ENTER。

Right-click DisableLoopbackCheck, and then click Modify.

右键单击DisableLoopbackCheck,然后单击Modify。

In the Value data box, type 1, and then click OK.

在值数据框中,键入1,然后单击OK。

Quit Registry Editor, and then restart your computer.

退出注册表编辑器,然后重新启动计算机。

#2


12  

I got a new PC with Windows 7. I installed VS2010 and my development environment and hoped my F5 debug problem would be gone, but it still failed to start the debugger.

我买了一台装有Windows 7的新电脑。我安装了VS2010和我的开发环境,希望我的F5调试问题会消失,但它仍然没有启动调试器。

This was a good clue since it ruled out the install of software.

这是一个很好的线索,因为它排除了安装软件的可能性。

I finally traced it down to my HOSTS file. I had an entry for some of my local websites which I can access like "http://testsite.lcl" but the IP I had assigned was my machine's IP instead of using 127.0.0.1 so it looked like a remote server to VS2010. Changing back to 127.0.0.1 resolved the issue.

我终于找到了我的主机文件。我有一个本地网站的入口,我可以访问http://testsite。但是我分配的IP是我的机器的IP,而不是使用127.0.0.1,所以它看起来像是VS2010的远程服务器。更改回127.0.0.1解决了这个问题。

Thanks for everyone's help on this.

谢谢大家的帮助。

#3


10  

I had the same problem. How did I fixed it.

我也有同样的问题。我怎么修复的?

Go to IIS (in my case IIS 7 / Windows 7). Select your web site from the list, click on .NET Compilation in ASP.NET section. Select Open Feature. Check if your Debug is set to True. In my case it was False. Once I changed it to True - I have my debug back :)

到IIS(在我的例子中是iis7 / Windows 7)。从列表中选择你的网站,点击。net编译。净截面。选择打开功能。检查您的调试是否设置为True。就我而言,这是假的。一旦我将它更改为True—我将调试返回:)

#4


6  

These steps my differ depending on your version of Windows. I am using 7 with iis 7.

这些步骤我的不同取决于你的Windows版本。我正在使用7和iis 7。

Open IIS Manager, click on Application Pools and find the 2 ASP.NET v4.0 pools (One is called "ASP.NET v4.0" the other "ASP.NET v4.0 Classic". Chances are that first one is stopped. Do not start it yet, we need to investigate a bit more.

打开IIS管理器,点击应用程序池并找到两个ASP。NET v4.0池(其中一个称为“ASP”。NET v4.0“另一个”ASP。净v4.0经典”。很有可能第一个被阻止。现在还不开始,我们还需要进一步研究。

For the "ASP.NET v4.0" pool, check the name in the Identity Field. Is it ApplicationPoolIdentity? Remember the name.

“ASP。NET v4.0“池,检查标识字段中的名称。ApplicationPoolIdentity吗?记得这个名字。

Open Computer Management (right click on My Computer and select Manage). Expand Event Viewer, then Windows Logs. Click on Application and wait for the data to load. There should be an error with a source of User Profile Service with a message that starts with "Windows cannot log you on because your profile cannot be loaded. Check that you are connected to the network, and that your network is functioning correctly."

打开计算机管理(右键单击我的计算机并选择Manage)。展开事件查看器,然后是Windows日志。单击应用程序并等待数据加载。如果用户配置文件服务的源出现错误,其消息以“Windows无法登录您,因为您的配置文件无法加载”开头。检查你是否连接到网络,你的网络是否正常运行。

If you do find that, then you have the same problem as I did.

如果你找到了,你就会遇到和我一样的问题。

The Solution: Go back to IIS Manager and right click on "ASP.NET v4.0" and select Advanced Settings. Under Process Model, the first field is Identity. Change this from ApplicationPoolIdentity to NetworkService. Click OK.

解决方案:回到IIS管理器,右键单击“ASP”。并选择高级设置。在流程模型中,第一个字段是Identity。将其从应用程序poolidentity更改为NetworkService。单击OK。

Now start the pool if it did not restart automalically. Go back to your application and press F5 (start debug) and your application should work.

如果池没有自动重启,现在启动池。回到您的应用程序并按F5(开始调试),您的应用程序应该可以工作。

Please note that I have not figured out why this works, and this may be a security risk, but at least you will be able to do some work while you think about this.

请注意,我还没有弄明白为什么这是有效的,这可能是一个安全风险,但至少您可以在考虑这个问题时做一些工作。

#5


4  

I had this problem in Visual Studio 2012 when running a website I had created in Visual Studio 2010. I tried each of the following, which did not solve the problem, but still may have been required:

我在2012年的Visual Studio中遇到过这个问题,当时我在Visual Studio 2010中创建了一个网站。我尝试了以下的每一种,并没有解决问题,但可能仍然需要:

  1. Checked that the App Pool was targeted to the same framework as what was specified in the web.config

    检查应用程序池是否针对与web.config中指定的相同的框架

    <compilation defaultLanguage="c#" debug="true" targetFramework="4.0">
  2. Started the 64bit Remote Debugger: \Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Remote Debugger\x64\msvsmon.exe

    启动64位远程调试器:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Remote Debugger\x64\msvsmon.exe

  3. Set the DisableLoopbackCheck registry key and restarted Windows. MS Instructions here

    设置DisableLoopbackCheck注册表项并重新启动Windows。说明女士在这里

  4. Browsed the site locally (it came up just fine).

    在本地浏览该网站(结果还不错)。

  5. Finally I found the IIS setting that fixed the issue.

    最后我找到了解决问题的IIS设置。

    1. Go to IIS (7.5 in my case) and click on the relevant site in the Sites node.
    2. 转到IIS(在我的情况下是7.5)并单击site节点中的相关站点。
    3. Double click .NET Compilation in the ASP.NET section
    4. 在ASP中双击. net编译。净截面
    5. Under Behavior, set Debug to True.
    6. 在行为下,将Debug设置为True。
    7. Click Apply and run the site in Visual Studio.
    8. 单击Apply并在Visual Studio中运行站点。

#6


3  

You can firstly deploy your web application/site with your iis, then open your visual studio 2010. Then click "File"->open->website->Local IIS Site, then select your website/application. Then you will find that the debug may works. This method works for my case.

您可以先将web应用程序/站点部署到iis中,然后打开visual studio 2010。然后点击“File”->打开->网站->本地IIS网站,然后选择您的网站/应用程序。然后您将发现调试可能是有效的。这种方法适用于我的情况。

#7


3  

I had the same issue on Win7 and VS2010 (without ReSharper) and found that Skype listened on port 80. IIS listens to port 80 by default. This can occur when you set VS to debug an existing web application running in IIS instead of the built in ASP.NET debug web server.

我在Win7和VS2010(没有ReSharper)也有同样的问题,发现Skype在80端口上监听。IIS默认监听端口80。当您将VS设置为调试在IIS中运行的现有web应用程序而不是在ASP中构建的应用程序时,就会发生这种情况。网络调试web服务器。

I solved the issue by unchecking "Use ports 80 and 443 as alternatives for incoming connections." in Skype under Tools -> Options -> Connection, followed by a restart of Skype.

我解决了这个问题,取消了“使用端口80和443作为进入连接的替代”,在Skype的工具——>选项——>连接,然后重启Skype。

#8


2  

What worked for me was to go into IIS at the server level, click on ISAPI and CGI restrictions, I found that aspnet_isapi.dll for asp.net 4.0 was set to Not Allowed. I set it to allowed and debugging worked. The steps are:

我的工作是进入服务器级别的IIS,点击ISAPI和CGI限制,我发现aspnet_isapi。net 4.0的dll设置为不允许。我将它设置为允许并调试工作。的步骤是:

  1. Open IIS.
  2. 打开IIS。
  3. Click on the top level
  4. 单击顶部
  5. Select ISAPI and CGI Restrictions under IIS in the Features view
  6. 在“特性”视图中选择IIS下的ISAPI和CGI限制
  7. Examine the Descriptions and if ASP.NET v4[current version] has the Not Allowed Restriction, click on the "Allow" link in the Actions section of the dialog.
  8. 检查描述和if ASP。NET v4[当前版本]具有不允许的限制,单击对话框的Actions部分中的“允许”链接。

This change should take care of the problem. Note that I came up with this solution when I tried to run the web app withoug debugging and I came up with the following error:

这个变化应该能解决这个问题。请注意,当我尝试在不进行调试的情况下运行web应用程序时,我提出了这个解决方案,我发现了以下错误:

HTTP Error 404.2 - Not Found The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server.

HTTP错误404.2 -由于Web服务器上的ISAPI和CGI限制列表设置,您请求的页面没有找到,因此无法提供服务。

#9


1  

Another thing to try (this is what worked for me):

另一件值得尝试的事情(这对我很有效):

In IIS, click Application Pools > (Your Site) > Advanced Settings, and change "Enable 32-Bit Applications" to True.

在IIS中,单击应用程序池>(您的站点)>高级设置,并将“启用32位应用程序”更改为True。

#10


0  

I don't have a definite answer though these articles may have some helpful info:

我没有明确的答案,虽然这些文章可能有一些有用的信息:

Using Windbg to start with w3wp.exe This mentions windbg/cdb debuggers specifically, but this advice should work with Visual Studio talking to cdb (which is attached to w3wp).

使用Windbg启动w3wp。exe这特别提到了windbg/cdb调试器,但是这个建议应该适用于Visual Studio与cdb(附加到w3wp)的对话。

Remote debugging with Visual Studio The reason I mention remote debugging at all is that I had to use that a few times in the past to get Visual Studio to attach to w3wp.exe. W3wp.exe runs in a different session, so you can't directly attach a debugger to that.

远程调试和Visual Studio,我提到远程调试的原因是,我在过去必须使用几次,才能让Visual Studio附加到w3wp.exe。W3wp。exe在不同的会话中运行,因此不能直接将调试器附加到该会话中。

#11


0  

You have not mentioned what operating system you are using. But this might not be related to operating system. I am taking a guess here. If you are running on Windows 7, try running visual studio under Administrator previlages.

您还没有提到您正在使用的操作系统。但这可能与操作系统无关。我猜一下。如果您正在Windows 7上运行,请尝试在Administrator previlages下运行visual studio。

You can also try adding your user ID to the VS debugger users group. You can access user groups by reight clicking on computer name or my computer and selecting Manage. Under that you can find Users & Groups.

还可以尝试将用户ID添加到VS调试器用户组。您可以通过右键单击计算机名或我的计算机并选择Manage来访问用户组。在那你可以找到用户和组。

#12


0  

In IIS in the Directory Security TAB, if using SSL check "Ignore client certificate" if you are running it in your local PC.

在目录安全选项卡中的IIS中,如果使用SSL,如果在本地PC中运行,请检查“忽略客户端证书”。

#13


0  

I was getting this after a new install of Windows 7 that did not include IIS by default. After installing IIS, the default app pool was created to run under .NET 2.0. Though I was able to set the default App Pool to .net 4 from .net 2, I still got this error. I had to reinstall .net 4 in IIS to get it to work properly. That is, run C:\Windows\Microsoft.NET{FrameworkFolder}\v{FrameworkNumber}\aspnet_regiis -i

我是在安装了Windows 7之后才得到这个功能的,因为Windows 7默认不包括IIS。安装IIS之后,默认的应用程序池被创建为在。net 2.0下运行。虽然我可以从。net 2将默认的应用程序池设置为。net 4,但是我还是得到了这个错误。我必须在IIS中重新安装。net 4才能使它正常工作。也就是说,C:\Windows\Microsoft.运行净v { FrameworkNumber } { FrameworkFolder } \ \ aspnet_regiis -我

#14


0  

What worked for me was to edit the HOSTS file in the C:\Windows\System32\drivers\etc folder and set the loopback for the website name I'd setup.

为我工作的是编辑的主机文件C:\Windows\System32\drivers\etc文件夹并设置回送我设置的网站名称。

For example:
127.0.0.1 http://guyellisrocks.com/

例如:127.0.0.1 http://guyellisrocks.com/

#15


0  

I've had the same issue and in my case it happened because the AppPool identity was set to impersonate an AD user which had its password changed. Therefore the process could not start and the AppPool always stopped when trying to debug from VS.

我也遇到过同样的问题,在我的例子中,这是因为AppPool标识被设置为模拟一个修改了密码的广告用户。因此,进程无法启动,当尝试从VS调试时,AppPool总是停止。

After updating the password in the AppPool/Advanced Settings/Identity everything started running smoothly.

在更新AppPool/Advanced Settings/Identity中的密码之后,一切都开始平稳运行。

#16


0  

Check whether the msvsmon.exe (Visual studio Remote Debugging Monitor) file is existing in the below path: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x64

检查是否msvsmon。exe(Visual studio远程调试监视器)文件中存在如下路径:C:\Program Files (x86)\Microsoft Visual studio IDE 10.0 \ Common7 \ \ \ x64远程调试器

If the file does not persist on the above mentioned path,then you need to get it from any other machine which is having the same version of Visualstudio.

如果文件没有在上面提到的路径上持久存在,那么您需要从具有相同版本的Visualstudio的任何其他机器上获取它。

#17


0  

Having tried all of the solutions above, I was still having this issue. Other projects were debugging without issue, so I knew it had to be something to do with this particular application's configuration.

在尝试了以上所有的解决方案之后,我仍然有这个问题。其他项目在调试时没有出现问题,所以我知道这一定与这个特定应用程序的配置有关。

Mine is an MVC app running under IIS 8. The issue was with URL Rewriting.

我的是一个在iis8下运行的MVC应用程序。问题是URL重写。

I had a rule to enforce trailing slashes. All I had to do was disable it (which can be done in IIS directly, or via the web.config below - just set enabled="false")

我有一条规则强制执行斜杠。我所要做的就是禁用它(可以直接在IIS中完成,也可以通过web来完成)。下面的配置-只设置enabled="false")

 <rewrite>
        <rules>
            <rule name="AddTrailingSlashRule1" enabled="false" stopProcessing="true">
                <match url="(.*[^/])$" />
                <conditions>
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                </conditions>
                <action type="Redirect" url="{R:1}/" />
            </rule>
        </rules>
    </rewrite>

#18


0  

Unload project, right click "edit abc.csproj" You will see the configuration. If your project is mapped to use IIS Web Express url.

卸载项目,右键单击“编辑abc”。你会看到配置。如果您的项目被映射为使用IIS Web Express url。

<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>6270</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://matrimonyfree.in/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>

verify If you have started the web site in IIS http://matrimonyfree.in in this case

验证是否在IIS http://matrimonyfree中启动了web站点。在这种情况下

#19


0  

It may also be because of some special or illegal format in your config file i will suggest you to check for that first .

这也可能是因为您的配置文件中某些特殊或非法的格式,我建议您首先检查一下。

In my case i was getting an error because of that when i tried to browse my service from IIS it showed me the real error .

在我的例子中,我得到了一个错误,因为当我试图从IIS浏览我的服务时,它显示了真正的错误。

#20


0  

I tried every single solution put online to resolve this issue and nothing seems to work consistently.

为了解决这个问题,我尝试了网上的每一个解决方案,但似乎没有一个方案是始终有效的。

I eventually solved it in both 2010 and 2012 by tracking it down to the following missing file in the Debug Source Files setting

我最终在2010年和2012年解决了这个问题,通过跟踪到调试源文件设置中丢失的以下文件

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\src\mfc\

Solution > Properties > Debug Source Files >

解决方案>属性>调试源文件>

Check to ensure all the files are there then remove this entry and everything worked again.

检查以确保所有的文件在那里,然后删除这个条目和一切工作再次。

#21


0  

Did you change your bindings on your IIS website? If so, you need to go to your project properties, select the Web tab, and change the Project Url to match your binding. so where it says http:///yourwebsite change it to http:///yourwebsite

您是否更改了IIS网站上的绑定?如果需要,您需要转到项目属性,选择Web选项卡,并更改项目Url以匹配绑定。所以它说http:///yourwebsite就改成http:///yourwebsite

This worked for me.

这为我工作。

#22


0  

In my case it was the system.webServer > httpErrors > errorMode in the web.config that caused the problem.

在我看来,这是系统。webServer > httpErrors在web上的errorMode。引起问题的配置。

If you have errorMode="Custom" try this:

如果你有errorMode="Custom",试试这个:

<httpErrors errorMode="DetailedLocalOnly">

See this answer: https://*.com/a/15585629/631277 for variations and other ideas concerning URL rewriting

请参见以下答案:https://*.com/a/15585629/631277,了解有关URL重写的变化和其他想法

#23


0  

I had same issue with Visual Studio 2013. In my case I had removed the "Default Web Site" from IIS. To resolve the issue I created the default website again, set physical path to C:\inetpub\wwwroot and port to 80 (default port). After restarting the Visual Studio it worked perfectly. Hope it helps someone.

我对Visual Studio 2013也有同样的看法。在我的例子中,我已经从IIS中删除了“默认Web站点”。为了解决这个问题,我再次创建了默认的网站,将物理路径设置为C:\inetpub\wwwroot和port设置为80(默认端口)。在重新启动Visual Studio之后,它运行得非常好。希望它能帮助一些人。

#24


0  

VS2010错误:无法在web服务器上启动调试

Unable to start debugging on web server. the web server not configured correctly.

无法在web服务器上启动调试。web服务器配置不正确。

How to resolve this problem?

如何解决这个问题?

Step-1

步骤1

open Command Prompt (Run as administrator)

打开命令提示符(作为管理员运行)

Step-2

步骤2

C:\Windows\system32>cd..

C:\Windows\ system32系统> cd . .

C:\Windows>cd Microsoft.NET

cd C:\ Windows > Microsoft.NET

C:\Windows\Microsoft.NET>cd Framework

C:\Windows\Microsoft.净> cd框架

C:\Windows\Microsoft.NET\Framework>cd v4.0.30319

C:\Windows\Microsoft.净\ > cd v4.0.30319框架

C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis.exe -i

C:\Windows\ Microsoft.NET \ Framework \ v4.0.30319 > aspnet_regiis。exe -我

#25


-1  

Your solution file in visual studio is broken. It's a known issue when converting from a file-system website to an IIS website, and it has been carried over from 2008 to 2010. Not sure of the location for the bug report on ms's kb site, though.

visual studio中的解决方案文件被破坏。当从文件系统网站转换到IIS网站时,这是一个众所周知的问题,从2008年一直延续到2010年。但是不确定ms的kb站点上的错误报告的位置。

Remove the website from the solution file (right click the project name, click "remove"). Then right click the solution name, click "add existing web site". When the dialog to add a web site comes up, choose "from IIS" in the left-hand pane. Navigate to your application in IIS, select "use secure sockets layer" if necessary, and click "finish" (or whatever that button is labeled).

从解决方案文件中删除网站(右键单击项目名称,单击“删除”)。然后右键单击解决方案名称,单击“添加现有web站点”。当出现要添加web站点的对话框时,请在左侧窗格中选择“from IIS”。导航到IIS中的应用程序,如果需要,选择“使用安全套接字层”,然后单击“finish”(或任何标记的按钮)。

this will permanently fix the issue.

这将永久性地解决这个问题。

#26


-1  

Unable to start debugging on web server. the web server not configured correctly.

无法在web服务器上启动调试。web服务器配置不正确。

  1. How To Resolve This Problem?

    如何解决这个问题?

    Step-1

    步骤1

    open Command Prompt(Run as administrator)

    打开命令提示符(作为管理员运行)

    Step-2

    步骤2

    C:\Windows\system32>cd..

    C:\Windows\ system32系统> cd . .

    C:\Windows>cd Microsoft.NET

    cd C:\ Windows > Microsoft.NET

    C:\Windows\Microsoft.NET>cd Framework

    C:\Windows\Microsoft.净> cd框架

    C:\Windows\Microsoft.NET\Framework>cd v4.0.30319

    C:\Windows\Microsoft.净\ > cd v4.0.30319框架

    C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis.exe -i Microsoft (R) ASP.NET RegIIS version 4.0.30319.0 Administration utility to install and uninstall ASP.NET on the local machine. Copyright (C) Microsoft Corporation. All rights reserved. Start installing ASP.NET (4.0.30319.0). .................. Finished installing ASP.NET (4.0.30319.0).

    C:\Windows\ Microsoft.NET \ Framework \ v4.0.30319 > aspnet_regiis。exe -i Microsoft (R) ASP。NET RegIIS版本4.30319.0用于安装和卸载ASP的管理工具。NET在本地机器上。版权(C)微软公司。保留所有权利。开始安装ASP。净(4.0.30319.0)。..................完成安装ASP。净(4.0.30319.0)。

    C:\Windows\Microsoft.NET\Framework\v4.0.30319>

    C:\Windows\ Microsoft.NET \ Framework \ v4.0.30319 >

#27


-2  

One of the things to check is to make sure if IIS is up and running. Something as simple as that would resolve this issue sometimes.

要检查的事情之一是确保IIS是否已经启动并运行。像这样简单的事情有时会解决这个问题。