由visual studio撰写的日志
试图运行项目时出错:无法在web服务器上启动项目的解决办法
十一 3rd
在Visual Studio中启动Web项目的调试时,出现如下的错误(错误提示见附件):
自动附加到计算机“Firehack”上的进程“[5676] w3wp.exe”失败。错误代码为 0×8013134b。
Auto-attach to process ‘[2440] w3wp.exe’ on machine ‘Firehack’ failed. Error code 0×8013134b.
其中关键的一点是出现了一个错误代码 0×8013134b。
出现这个错误的原因很简单:因为安装ASP.NET 2.0(或者针对.NET 2.0的补丁) 后,.NET 2.0 自动将IIS中所有的站点属性中的“ASP.NET版本” 设置为 2.0.50727,虽然站点仍旧能够正常访问,但是Visual Studio 2003就无法启动调试了的。
因此解决方法也就出现:
- 打开“Internet 信息服务(IIS)管理器),开始-运行-inetmgr;
- 在出现问题的站点上右键-属性;
- 选中“ASP.Net”标签;
- 修改“ASP.NET版本” 为 1.*.*;
- 应用后,重新启动调试。
————–英文信息—————
Attached the process w3wp.exe on my machine. Then I got the following error:
Auto-attach to process ‘[2440] w3wp.exe’ on machine ‘…’ failed. Error code 0×8013134b.
The problem was that I had installed .NET 2.0 which had registered ASP.NET 2.0 on the Web Site I was trying to debug.
Fixing it is simple:
- Run the IIS Manager
- Right click on the web site with the problem
- Click the ASP.NET tab
- Change the ASP.NET version from 2.something to 1.something in the combo and debugging works again
Upon changing to 1.something, the debugging worked.
程序“[1912] w3wp.exe: DefaultDomain”已退出,返回值为 0 (0×0)
八 25th
附件:error.txt(7215 Byte)
无法在Web服务器上启动调试。与Web服务器通信时出现身份验证错误
三 3rd
使用Visual Studio 2005(Visual Studio 2008亦存在此问题)调试设置了主机头的网站时出现如下错误信息:
—————————
Microsoft Visual Studio
—————————
无法在 Web 服务器上启动调试。与 Web 服务器通信时出现身份验证错误。请参阅“帮助”以协助解决问题。
—————————
项目属性的Web中设置“项目URL”为 http://www.msdi.cn/MultiWeb
如果将“项目URL”指定为 localhost 则在设置时不会出现以上的错误,所以排除了网上绝大部分文章提供的“集成Windows身份验证”,项目属性中“启用调试”的解决方案。
真正的解决方法如下:
步骤 1: 禁用环回检查
请遵循以下步骤:
1. 打开注册表编辑器(单击 开始 , 单击 运行 , 类型 regedit然后单击 确定 )。
2. 中注册表编辑器, 找到并单击以下注册表项:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
3. 右击 Lsa , 指向 新建 , 然后单击 DWORD 值 。
4. 类型 DisableLoopbackCheck然后按 Enter。
5. 右击 DisableLoopbackCheck , 然后单击 修改 。
6. 在 数值数据 框中, 键入 1然后单击 确定 。
7. 退出注册表编辑器, 并重新启动计算机。 (可以不重启计算机)
步骤 2: 指定主机名
要指定主机名, 映射到环回地址并可连接到 Web 站点上, 请按照下列步骤:
1. 打开注册表编辑器(单击 开始 , 单击 运行 , 类型 regedit然后单击 确定 )。 。
2. 中注册表编辑器, 找到并单击以下注册表项:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
3. 右击 MSV1_0 , 指向 新建 , 然后再单击 多字符串值 。
4. 类型 BackConnectionHostNames然后按 Enter。
5. 右击 BackConnectionHostNames , 然后单击 修改 。
6. 在 数值数据 框中, 键入主机名或主机名为站点所在的本地计算机名称, 确定 。
7. 退出注册表编辑器, 并重新启动 IISAdmin 服务。
这个错误的信息只会出现在特定环境的计算机中:This issue only appears on Web Sites configured with a host header on machines with IIS 6 or IIS 5.1 and the RTM version of the .Net Framework 3.5 SP1.
参考文章:
当您浏览位置 IIS 5.1 或 IIS 6 上的网站并且使用集成身份验证时,会收到 401.1 错误
Debugging A Web Site With A Host Header
关于条件编译:#if #else #endif
二 26th
条件编译就是按条件对程序的一部分进行编译,其它部分不编译。条件编译的目的是使源代码能更迅速、更容易地进行修改,并使目标代码缩短。
Visual Studio 2003和Visual Studio 2005都提供了条件编译的功能,并且将起作用的代码以高亮显示,被条件排除的错码显示为灰色。
设置条件编译的位置:
Visual Studio 2003:工程属性->配置属性->生成->条件编译常数(Project->Properties->Configuration->Build)
Visual Studio 2005:在打开类库的属性->生成->常规中的"条件编译符号"
条件编译符号需要多个时,使用“,”,“;”,“ ” (逗号,分号,空格)三种符号分隔,都可以
在以下代码中如果定义了 NET1就执行:
assembly: AssemblyProduct("Discuz!NT 2.0 (.net Framework 1.1)")
如果没有定义就执行:
assembly: AssemblyProduct("Discuz!NT 2.0 (.net Framework 2.x/3.x)")
- #if NET1
- [assembly: AssemblyProduct("Discuz!NT 2.0 (.net Framework 1.1)")]
- #else
- [assembly: AssemblyProduct("Discuz!NT 2.0 (.net Framework 2.x/3.x)")]
- #endif
自动生成Visual Studio 2005配色方案
十一 12th
选择Visual Studio 2005编辑器的前景色、背景色和对比度自动生成配色方案(*.vssettings),最后通过Visual Studio 2005的“导入和导出设置向导”导入字体和颜色的设置。
访问Visual Studio Theme Generator
以下是Visual Studio Theme Generator 提供的英文帮助
To Create A Theme
- Select your Colors and Contrast settings on the left
- Press refresh in the preview window
- Click Create to save your new theme (ie users will need to file save as on the next screen)
To install the new settings file:
- Click tools
- Import and Export Settings
- Choose ‘Import Selected Environment Settings’ and click Next
- Backup current settings and continue
- Browse to the download location and click Next
- The Next screen you can confirm that you’re overwriting just the fonts and color and click Finish
VS2005:由于页中存在错误,无法切换到设计视图
六 6th
在使用VS2005时经常会出现无法从源视图切换到设计视图的问题。
—————————
Microsoft Visual Studio
—————————
由于页中存在错误,无法切换到设计视图。请更正错误列表中标记为“无法切换:”的所有错误,然后重试。
—————————
确定
—————————
原因是页面有未闭合的html标记,根据Visual Studio 2005的错误提示找到改过来。
类似的错误提示如下:
错误 29 无法切换视图: 此结束标记没有匹配的开始标记。 F:\SCFD\WebRoot\SCFD\PortalInfor\FocusNewsEdit.aspx 158 8 scfd
错误 41 无法切换视图: 验证 (HTML 4.01): 在标记中属性“class”只能指定一次。 F:\SCFD\WebRoot\SCFD\PrjOutgoingFile\PrjOutgoingFileWflow.aspx 196 38 scfd
即在错误列表中查看提示“”的错误,并更正即可。
最近评论