一个经得起时间考验的人
ASP.net
VS2003打开.net工程提示"无法读取项目文件portal.csproj.系统找不到指定路径"
六 11th
使用Microsoft Visual Studio 2003打开.net解决方案时提示(如截图1所示):
—————————
Microsoft Development Environment
—————————
无法读取项目文件“portal.csproj”。系统找不到指定的路径。
—————————
确定
—————————
经过检查浏览器的代理设置,重新定位portal项目的位置,检查portal.csproj.webinfo文件等操作都无法解决此问题。
同时发现如果在删除portal项目后新建同名的项目时会提示:项目错误。
奇怪的VS2003!
在最后无路可走时,把解决方案ZhongNan.sln目录中的同名文件ZhongNan.suo(为隐藏文件)删除,如截图2所示,结果VS2003正常了。
The solution user options (.suo) file is a structured storage, or compound, file stored in a binary format. You save user information into streams with the name of the stream being the key that will be used to identify the information in the .suo file.
|
{VS打开.net工程提示"无法读取项目文件"web.csproj",系统找不到指定路径"}其他可能的原因: http://hi.baidu.com/kmiaoer/blog/item/75f502083b463f38e8248805.html 解决 无法读取项目文件"***.csproj",系统找不到指定路径 解决办法: 解决路径不对: 解决版本不对: |
关于条件编译:#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
异常来自 HRESULT:0×80005008 的解决方案
二 6th
使用 Active Directory Service Interfaces (ADSI) 来枚举虚拟目录的元数据库属性时出现如下异常消息:异常来自 HRESULT:0×80005008。
Microsoft的官方解释是:
在 Internet Information Services (IIS) 6.0 中,,您使用 Active Directory Service Interfaces (ADSI) 来枚举虚拟目录的元数据库属性。 如果将 IPSecurity 属性虚拟目录中元数据库包含二进制数据,可能会收到以下错误信息:
异常来自 HRESULT:0×80005008
出现此问题是由于 CreatePropEntry 功能的 Active Directory 服务接口提供程序 (Adsiis.dll) 中的一个问题。
解决0×80005008异常的办法是安装补丁包:WindowsServer2003-KB939573-v2-x86-CHS.exe(
Windows Server 2003
Chinese (Simplified)
x86
sp3
Fix203418)
可以访问此链接下载:http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=939573&kbln=zh-cn
填写邮箱地址后,WindowsServer2003-KB939573-v2补丁将发送至您的邮箱。使用邮件提供的密码解压压缩文件319188_CHS_i386_zip.exe即可得到补丁包:WindowsServer2003-KB939573-v2-x86-CHS.exe。
发生异常的C#代码:
- using System;
- using System.IO;
- using System.DirectoryServices;
- using System.Reflection;
- using System.Runtime.InteropServices;
- using System.Collections;
- namespace System_DirectoryServices_DirectoryEntry_ConfigIIS
- {
- class Program
- {
- static void Main(string[] args)
- {
- EnumerateProperties("IIS://Localhost/W3SVC/1/Root");
- }
- static void EnumerateProperties(string metabasePath)
- {
- // metabasePath is of the form "IIS://<servername>/<path>"
- // for example "IIS://localhost/W3SVC/1/Root/MyVDir"
- // or "IIS://localhost/W3SVC/AppPools/MyAppPool"
- Console.WriteLine("\nEnumerating properties for {0}:", metabasePath);
- try
- {
- DirectoryEntry entry = new DirectoryEntry(metabasePath);
- PropertyCollection props = entry.Properties;
- Console.WriteLine(" Total properties = {0}", props.Count);
- foreach (string propName in props.PropertyNames)
- {
- Console.Write(" {0} =", propName);
- foreach (object value in entry.Properties[propName])
- {
- Console.WriteLine("\t{0} \t({1})", value.ToString(), value.GetType());
- }
- }
- Console.WriteLine(" Done.");
- }
- catch (Exception ex)
- {
- Console.WriteLine("Failed in EnumeratePath with the following exception: \n{0}", ex.Message);
- }
- }
- }
- }
程序集mscorlib引起的"在Web 窗体设计器中未能加载该文件"错误
四 25th
Visual Studio .NET 2003打开ASPX页面时出现如下错误:
—————————
Microsoft Development Environment
—————————
在 Web 窗体设计器中未能加载该文件。请更正下列错误,然后尝试重新加载:
未能从程序集 mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 中加载类型 System.Runtime.InteropServices.HandleRef。
确保在项目中生成或者引用了页中使用的所有类。如需更多信息,请单击“帮助”。
—————————
无法看到ASPX页面的窗体设计器,当再次重新打开ASPX页面时,Visual Studio .NET 2003将产生“Fatal Execution Engine Error (0x7924d8e6)”错误,随后出现关于System.ExecutionEngineException的调试页面。
进行修复或者重新安装Visual Studio .NET 2003,重新安装ASP.NET Framework 1.1等操作都无法解决。
最后通过重新安装操作系统才解决此问题,在此留下个记号。
Windows2003中重新安装ASP.NET Framework 1.1的方法
四 25th
因为ASP.NET Framework 1.1是Windows操作系统固有的一个组件,所以无法直接删除或重新安装.但是Microsoft Support提供了一个重新安装ASP.NET Framework 1.1的方法.
此方法的步骤如下:
- 1. 从 Windows 注册表中手动删除 netfx 注册表值。为此,请按照下列步骤操作:
- a. 单击“开始”,然后单击“运行”。
- b. 在“打开”文本框中,键入 regedit,然后单击“确定”以启动注册表编辑器。
- c. 在注册表编辑器中,找到并单击下面的注册表项:
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\OC Manager\Subcomponents
- d. 在注册表编辑器右窗格中的“名称”下面,右键单击“netfx”,然后单击“删除”。
- e. 在“确认数值删除”对话框中,单击“是”。
- f. 退出注册表编辑器。
- 2. 在位于 Windows 文件夹中的 Inf 文件夹中,创建一个设备信息 (.inf) 文件。为此,请按照下列步骤操作:
- a. 将以下文本粘贴到文本编辑器(如记事本)中:
- [Version]
- Signature = "$Windows NT$"
- DriverVer=10/01/2002,5.2.3790.0
- [Components]
- netfx=netfxocm.dll,UrtOcmProc,netfxocm.inf,,7
- b. 在“文件”菜单上,单击“保存”。
- c. 在“另存为”对话框中,找到并单击计算机上的“%Windows Folder%\inf”文件夹。
- 注意:%Windows Folder% 是 Windows 文件夹路径的占位符。
- d. 在“保存类型”下拉列表框中,单击“所有文件”。
- e. 在“文件名”文本框中,键入 sysnew.inf,然后单击“保存”。
- 3. 运行 Windows 可选组件 (OC) 安装程序向导,重新安装 .NET Framework 1.1。为此,请按照下列步骤操作:
- a. 单击“开始”,然后单击“运行”。
- b. 在“打开”文本框中,键入 cmd,然后单击“确定”。
- c. 在命令提示符处,运行以下命令以启动 Windows OC 安装程序向导:
- sysocmgr /i:%Windows Folder%\inf\sysnew.inf
- 注意:%Windows Folder% 是 Windows 文件夹路径的占位符。
- d. 在 Windows OC 安装程序向导的“Windows 组件”页面上,单击“下一步”重新安装 .NET Framework 1.1。
- 注意:如果出现“所需文件”对话框,请在“文件复制来源”文本框中键入 i386 安装文件夹的路径,然后单击“确定”。此 i386 文件夹位于您安装操作系统的文件夹中。
- 4. 手动安装全局程序集缓存中的程序集。为此,请按照下列步骤操作:
- a. 单击“开始”,然后单击“运行”。
- b. 在“打开”文本框中,键入 cmd,然后单击“确定”。
- c. 在命令提示符处,运行以下命令(在一行中键入此命令):
- "%Windows Folder%\Microsoft.NET\Framework\v1.1.xxxx\gacutil.exe" /f /il %Windows Folder%\Microsoft.NET\Framework\v1.1.xxxx\assemblylist.txt
- 注意
- 1)%Windows Folder% 是 Windows 文件夹路径的占位符。
- 2)xxxx 是您要修复的 .NET Framework 1.1 的内部版本号的占位符。
其中:“%Windows Folder%” 是指 c:\windows
“.NET Framework 1.1 的内部版本号的占位符”是指4322
如果系统安装了SP2补丁,在修复的过程中将需要使用到SP2补丁的安装光盘。如果没有安装光盘可以运行一下SP2补丁的Exe文件,把生成的一个随机名称的目录中的i386目录复制出来,然后指定为复制出来的目录即可。
Visual Studio .NET调试项目出错-验证您是服务器上“Debugger Users”组的成员
四 16th
Visual Studio .NET调试项目时出现如下错误信息:
—————————
Microsoft 开发环境
—————————
试图运行项目时出错: 无法在 Web 服务器上启动调试。您没有调试该服务器的权限。
验证您是服务器上“Debugger Users”组的成员。
出现此错误的机器使用的是IE7,在对比了可以正常调试的机器的IE设置后发现:
原来Windows 2003在升级到IE7后,Internet选项中的安全选项卡的内容都被重新设置了。
因此只需要把受信任站点的“自定义级别”设置为“低”就正常使用Visual Studio .NET 2003 的调试功能了。
后来通过Google找到了问题的根源
解决方法:
1.将http://localhost加到可信站点中.(从IE的工具菜单—->Internet选项—–>安全标签)
2.在IE选项->"安全设置"->"可信站点"->"自定义级别"里有"用户验证",确认选中"自动使用当前用户名和密码登录",如图所以。发现如果“自定义级别”设置为“低”那么自动选中“自动使用当前用户名和密码登录”