5

I'm using 1.0.0-beta7 x64 but visual studios insists I'm using x86. When I delete all my runtimes except the one I'm targeting I get this:

enter image description here

I can't find a reference to x86 anywhere in my project.

enter image description here

When I hover over the Solution DNX SDK version here it shows the x86 version but I don't know where it's getting this from. Currently this isn't causing any problems I'm just trying to understand what's going on.

Magpie
  • 6,983
  • 14
  • 51
  • 67
  • look for a web.config file in the wwwroot folder, it has appsettings that are used to bootstrap the runtime – Joe Audette Oct 07 '15 at 12:42
  • @JoeAudette there is no web.config. I thought that was a thing of the past. Searched wwwroot and sub folders just in case but there was no web.config. – Magpie Oct 07 '15 at 12:55
  • if you create a new web app in vs2015 with beta 7 tooling it will add a web.config either upon build or publish. and there will also be a wwwroot/bin folder with a single dll used to bootstrap the runtime. However that is going away in beta8 with the new hosting model. I only commented because at one time I also had a case where it was not using the intended runtime and it was caused by the web.config. maybe your case is different. – Joe Audette Oct 07 '15 at 13:35
  • I see. Looks like I've hit a different issue. Most likely something that will get ironed out during the beta ). – Magpie Oct 07 '15 at 14:02
  • do `dnvm list` and check what is your default runtime. It can be that the runtime whose alias is `default` does not exist. Close vs and alias the x64 runtime as your default (i.e. `dnvm alias default 1.0.0-beta8 -arch x64 -r clr`) open VS and see if it works. – Pawel Oct 07 '15 at 20:48
  • Thanks for the comment. Tried this as I didn't have a default alias but alas it didn't help. – Magpie Oct 09 '15 at 08:46

2 Answers2

1

Right-click in your, web (not solution) project and select Properties. Click "Use Specific Runtime" and pick the dnx runtime that you want from the dropdown. All this does is set the "sdkVersion" in the /Properties/launchSettings.json of your project.

Set project specific dnx runtime

The "sdk" in your global.json indicates the minimum sdk version that the project will run but won't run your project against it. It'll take the setting you have in launchSettings.json instead.

Dealdiane
  • 3,984
  • 1
  • 24
  • 35
  • Hi thanks for the answer but I've also tried this and it makes no difference. I still get the error message. – Magpie Oct 09 '15 at 08:40
  • Whaat does your launchSettings.json look like? – Dealdiane Oct 09 '15 at 09:04
  • { "profiles": { "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, "environmentVariables": { "ASPNET_ENV": "Development" }, "sdkVersion": "dnx-clr-win-x64.1.0.0-beta7" } } } – Magpie Oct 09 '15 at 09:42
  • I don't think you can force Visual Studio to use x64 as it uses it internally for the tooling to work. Since Visual Studio is running 32-bit, it can't load any x64 references. You can, however, use the above to force the architecture to x64 when you publish it. – Dealdiane Oct 11 '15 at 20:30
  • Ahh, Didn't think about VS itself. Yep it's 32 bit. I guess that's what it is. Thanks for the feed back. – Magpie Oct 13 '15 at 11:53
  • 1
    This seems to have disappeared on 1.0.0 release... Any ideas please? – Robula Jul 12 '16 at 15:16
1

Are you running a 32bit Windows?

If not, I would then suggest you clean out your runtimes.

C:\Users\USERNAME\.dnx\runtimes

Then do a fresh install dnvm upgrade or perhaps dnvm install <version>. Whilst you are at it you might as well update your dnvm as well dnvm update-self.

Then set your runtimes on the web project properties, and the global.json, to x64. If you are using IIS Express to debug, set to use 64 bit version of IIS Express.

64 bit

I hope this helps!

Nick De Beer
  • 5,232
  • 6
  • 35
  • 50
  • Thanks for the answer. I'm running 64bit windows and have tried all of the above but no luck. – Magpie Oct 13 '15 at 11:52