2

I downloaded beta8 for ASP.NET 5 and am trying to set it as the default for new Visual Studio projects. Using the Developer command prompt for Visual Studio 2015 I did:

dnvm use 1.0.0-beta8 -arch x64 -p

My command prompt now displays:

c:\>dnvm list

Active Version     Runtime Architecture Location                         Alias
------ -------     ------- ------------ --------                         -----
       1.0.0-beta5 clr     x64          C:\Users\username\.dnx\runtimes
       1.0.0-beta5 clr     x86          C:\Users\username\.dnx\runtimes
       1.0.0-beta5 coreclr x64          C:\Users\username\.dnx\runtimes
       1.0.0-beta5 coreclr x86          C:\Users\username\.dnx\runtimes
       1.0.0-beta7 clr     x86          C:\Users\username\.dnx\runtimes
  *    1.0.0-beta8 clr     x64          C:\Users\username\.dnx\runtimes
       1.0.0-beta8 clr     x86          C:\Users\username\.dnx\runtimes def...

However, when I now open Visual Studio 2015 and create a new ASP.NET 5 Web Application project, my global.json still says architecture x86 (the previous version), and my project does not build. Under References it says (Errors - see Error list) but there are too many errors to count. Doing 'Restore Packages' appears to do nothing.

How do I set Visual Studio 2015 to use this current version with x64 architecture (the architecture of my machine) and to create new projects so that they build successfully out of the box (like the previous version I was using)?

Drew
  • 2,601
  • 6
  • 42
  • 65

1 Answers1

2

First check it you have correct (beta8) version of VS tooling installed. Installing beta8 framework is not enough to run projects from VS and beta8 tooling is not the same as beta8 DNX. This step is crucial for building and running beta8 projects under VS. If your project does not build and run out of the box this is most likely what causes problems. You may check your version of ASP.NET and Web Tools under About Visual Studio in Help menu. See this answer for screenshot:

https://stackoverflow.com/a/33158692/926875.

You may find beta 8 VS tooling under:

http://www.microsoft.com/en-us/download/details.aspx?id=49442

I don't know if it is possible at all to force visual studio to run x64 framework. People seem to struggle with it for some time. See this questions for reference:

How to force Visual Studio to use x64 DNX SDK architecture

https://stackoverflow.com/questions/33013936/visual-studio-2015-nuget-package-restore-uses-x86-by-default?s=2|0.5929

If you need your project to be run under x64 from visual studio you may go to properties of your project and check "Use specific runtime".

From my experience most of the times architecture of dnx is not what causes issues. To make sure if this is not the case at first I would suggest using dnu restore and dnu build and then dnx run (or web or anything that runs your project) from command line and see if your project builds this way.

Community
  • 1
  • 1
pg0xC
  • 1,226
  • 10
  • 20
  • Thanks for the response. I did install beta 8 VS tooling. Changing my runtime architecure setting under project properties successfully built the project, however when running and viewing in the browser I get 'Could not load file or assembly 'dnx.clr.managed' or one of its dependencies. The system cannot find the file specified.' – Drew Oct 25 '15 at 00:43
  • Try setting the default allias. `dnvm alias default dnx-clr-win-x64.1.0.0-beta8` If you upgrading from beta 7 then be sure to read the upgrade nodes. – Thom Kiesewetter Oct 25 '15 at 16:57
  • Thanks, I tried this as well to no avail. No matter what I do, when creating projects in Visual Studio 2015 the project.json defaults to beta5. Even after manually changing all properties to beta8 and trying all of the above commands, the project will not build. – Drew Oct 26 '15 at 02:04
  • This is clearly a problem with VS tooling if your project is generated with beta5 dependencies. Tripple check version as in linked post, try uninstalling or repair. – pg0xC Oct 26 '15 at 15:40
  • If above won't help I suggest reinstalling VS community and then adding beta8 tooling. I had a problem before with tooling installer that broke my VS and I had to reinstall whole thing – pg0xC Oct 26 '15 at 15:44
  • I am using VS pro, uninstalled tooling and will try to repair VS before uninstalling. In any case going mark as complete as this is a different issue than the original question. Thanks for all of your help! – Drew Oct 28 '15 at 14:19