ResGen.exe 可能无法运行,因为命令行的长度为XX个字符,超过了命令的最大长度。若要解决此问题,请 (1) 删除不需要的程序集引用,或者 (2) 缩短这些引用的路径。
2014-11-25 16:35
791 查看
由 Microsoft 在 2010/2/15 於 15:52 公佈
Thanks, this is a known issue that's fixed for RTM but slipped through for RC. If you have Beta 2, please update to RC first. If you still have a the problem: essentially it's the length of the references that are putting the command line over the limit. Here's
some possible workarounds
(1) Target 4.0 until RTM comes out. Of course this isn't a serious workaround for most people, but if you're just experimenting with VS10, it might be acceptable.
(2) Remove any references from your project that you aren't actually using in your code. It's possible that might be sufficient to solve the problem. If not, follow these steps
(a) Dial up the build verbosity to Normal in Tools>Options>Project>Build.
(b) Build the project with the problem. Look in the build log for the resgen.exe command line. You’ll see the paths to your references. Find where the .NET Framework references are coming from. It’s probably something like "C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client”
(c) In a console window, use subst to make a drive letter that points there. Eg.,
Subst j: "C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client”
(d) Back in VS, open up the project properties and look for Reference Paths. It’s in slightly different places in the project properties for VB and C# projects. For VB projects go to the References tab and click the "Reference Paths" button. For C# projects,
go to the Reference Paths tab.
(e) Add “j:\” or whatever your subst drive was to the Reference Paths. If there's already entries, put it first.
(f) Your build should now succeed. If it doesn’t, that means that your remaining references are still too long. You can do the same technique, using a different drive, to point to where those are.
(g) If you have more than one project with this problem, you may be able to avoid setting the ReferencePath on all of them if they don’t already have a ReferencePath. Simply set an environment variable ReferencePath with the value “j:\” and launch VS from that
window.
Hope this helps. I'm going to blog about this on the Visual Studio Platform blog with screenshots to help with the workaround steps.
Dan (danmose@microsoft.com)
由微软在2010年2月15日于15:52公布
谢谢,这是的固定RTM,但下滑的通过RC的已知问题。如果您有Beta 2中,请升级到RC第一。如果您仍然有问题:实际上它是被放置在命令行超过限制的参考的长度。下面是一些可能的解决方法
(1)目标4.0至RTM出来。当然,这并不是一个严重的变通方法对于大多数人,但是如果你只是用VS10尝试,它可能是可以接受的。
(2)从你的项目,你实际上并没有使用你的代码的任何引用。这是可能的,可能是足以解决问题。如果没有,请按照下列步骤
(一)拨号构建冗长普通的工具>选项>项目>建设。
(二)建立与问题的项目。看在构建日志中resgen.exe命令行。你会看到路径的参考。寻找到.NET框架引用的来源。这也可能是类似“C:\ Program Files文件\参考大会\微软\框架\.NETFramework\ V4.0\档案\客户端”
(三)在一个控制台窗口中,使用SUBST,使驱动器盘符指向那里。如:,
SUBST记者:“C:\ Program Files文件\参考大会\微软\框架\.NETFramework\ V4.0\档案\客户端”
(四)早在VS,打开项目属性,并查找引用路径。这是在为VB和C#项目的项目属性略有不同的地方。对于VB项目去引用选项卡,然后单击“引用路径”按钮。对于C#项目,请参考路径选项卡。
(五)加入的“J:\”或任何你SUBST驱动器是参考路径。如果有已有的条目,把它先。
(六)构建您现在应该成功。如果没有,那意味着你其余的引用是仍然太长。你可以做同样的技术,使用不同的驱动器,以指向那些。
(七)如果你有一个以上的项目,这个问题,你可能能够避免设置ReferencePath上所有的人,如果他们不已经有一个ReferencePath。简单地设置环境变量ReferencePath与价值的“J:\”,并从该窗口中启动VS。
希望这会有所帮助。我会在博客上这样在Visual Studio平台的博客截图,以帮助解决方法步骤。
丹(danmose@microsoft.com)
Thanks, this is a known issue that's fixed for RTM but slipped through for RC. If you have Beta 2, please update to RC first. If you still have a the problem: essentially it's the length of the references that are putting the command line over the limit. Here's
some possible workarounds
(1) Target 4.0 until RTM comes out. Of course this isn't a serious workaround for most people, but if you're just experimenting with VS10, it might be acceptable.
(2) Remove any references from your project that you aren't actually using in your code. It's possible that might be sufficient to solve the problem. If not, follow these steps
(a) Dial up the build verbosity to Normal in Tools>Options>Project>Build.
(b) Build the project with the problem. Look in the build log for the resgen.exe command line. You’ll see the paths to your references. Find where the .NET Framework references are coming from. It’s probably something like "C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client”
(c) In a console window, use subst to make a drive letter that points there. Eg.,
Subst j: "C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client”
(d) Back in VS, open up the project properties and look for Reference Paths. It’s in slightly different places in the project properties for VB and C# projects. For VB projects go to the References tab and click the "Reference Paths" button. For C# projects,
go to the Reference Paths tab.
(e) Add “j:\” or whatever your subst drive was to the Reference Paths. If there's already entries, put it first.
(f) Your build should now succeed. If it doesn’t, that means that your remaining references are still too long. You can do the same technique, using a different drive, to point to where those are.
(g) If you have more than one project with this problem, you may be able to avoid setting the ReferencePath on all of them if they don’t already have a ReferencePath. Simply set an environment variable ReferencePath with the value “j:\” and launch VS from that
window.
Hope this helps. I'm going to blog about this on the Visual Studio Platform blog with screenshots to help with the workaround steps.
Dan (danmose@microsoft.com)
由微软在2010年2月15日于15:52公布
谢谢,这是的固定RTM,但下滑的通过RC的已知问题。如果您有Beta 2中,请升级到RC第一。如果您仍然有问题:实际上它是被放置在命令行超过限制的参考的长度。下面是一些可能的解决方法
(1)目标4.0至RTM出来。当然,这并不是一个严重的变通方法对于大多数人,但是如果你只是用VS10尝试,它可能是可以接受的。
(2)从你的项目,你实际上并没有使用你的代码的任何引用。这是可能的,可能是足以解决问题。如果没有,请按照下列步骤
(一)拨号构建冗长普通的工具>选项>项目>建设。
(二)建立与问题的项目。看在构建日志中resgen.exe命令行。你会看到路径的参考。寻找到.NET框架引用的来源。这也可能是类似“C:\ Program Files文件\参考大会\微软\框架\.NETFramework\ V4.0\档案\客户端”
(三)在一个控制台窗口中,使用SUBST,使驱动器盘符指向那里。如:,
SUBST记者:“C:\ Program Files文件\参考大会\微软\框架\.NETFramework\ V4.0\档案\客户端”
(四)早在VS,打开项目属性,并查找引用路径。这是在为VB和C#项目的项目属性略有不同的地方。对于VB项目去引用选项卡,然后单击“引用路径”按钮。对于C#项目,请参考路径选项卡。
(五)加入的“J:\”或任何你SUBST驱动器是参考路径。如果有已有的条目,把它先。
(六)构建您现在应该成功。如果没有,那意味着你其余的引用是仍然太长。你可以做同样的技术,使用不同的驱动器,以指向那些。
(七)如果你有一个以上的项目,这个问题,你可能能够避免设置ReferencePath上所有的人,如果他们不已经有一个ReferencePath。简单地设置环境变量ReferencePath与价值的“J:\”,并从该窗口中启动VS。
希望这会有所帮助。我会在博客上这样在Visual Studio平台的博客截图,以帮助解决方法步骤。
丹(danmose@microsoft.com)
相关文章推荐
- 密钥发行中心(KDC)找不到相应的证书用于智能卡登录,或者无法验证 KDC 证书。如果不解决该问题,智能卡登录可能不会正常工作。若要更正该问题,请使用 certutil.exe 验证现有的 KDC 证书或注册新的 KDC 证书。
- sql2008出现问题“因为无法为数据库 'MRsys' 中的对象 'dbo.T_USER_1311_DATA' 分配空间, 'PRIMARY' 文件组已满。请删除不需要的文件..."问题,解决了
- winrar解压缩eclipse出现“ 文件名或扩展名太长”或者“路径和文件名总长度必须不能超过260个字符”问题
- 解决大量TCPIP连接后出现“因为系统缺乏足够缓冲区空间或者因为队列已满无法执行套接字上操作”的问题
- 解决Tomcat.exe或者startup.bat 一闪无法打开的问题
- 在IE6下附件名称如果超过16或者18个字符,下载时会被截断,该问题的解决方法
- 解决大量TCPIP连接后出现“因为系统缺乏足够缓冲区空间或者因为队列已满无法执行套接字上操作”的问题
- "路径和文件名总长度必须不能超过 260 个字符! 系统找不到指定的路径"的解决方法
- sqlserver"无法删除数据库,因为该数据库当前正在使用"问题解决
- HBase Shell输入命令无法删除问题解决技巧
- jQuery在异步请求数据返回后,调用$("selector").html(data.content);之后因为一些特殊字符或者',"不能显示内容的问题解决办法
- Asp.net上传出现“超过了最大请求长度”的问题解决方法
- 解决在运行配置文件中指定的扩展时出现异常。 ---> System.Web.HttpException: 超过了最大请求长度问
- 解决自动更新因为EXE文件正在运行而失败的问题
- 解决应用程序与程序集不在同一目录下无法正常运行的问题
- 无法从命令行或调试器启动服务,必须首先安装Windows服务(使用installutil.exe),然后用ServerExplorer、Windows服务器管理工具或NET START命令启动它的解决
- devenv.exe - 系统错误无法启动此程序,因为计算机中丢失 MSVCR100.dll。尝试重新安装该程序以解决此问题。【解决办法】
- 巧用GetShortPathName解决带Unicode字符路径在非Unicode程序里的无法访问的问题
- 开发环境下调试没有问题,发布后运行却提示无法更新数据库 *.MDF,因为数据库是只读的解决方法
- 无法启动虚拟化 因为虚拟机管理程序未运行问题解决方法