(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 ([email protected])
由微软在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平台的博客截图,以帮助解决方法步骤。
丹([email protected])