Start an asp.net core project as x86 under visual studio 2015

前端 未结 3 549
-上瘾入骨i
-上瘾入骨i 2020-12-18 09:48

I have a vs2015 solution containing an asp.net core project and have configured its project.json as follow :

{
  \"buildOptions\": {
    \"emitEntryPoint\":          


        
相关标签:
3条回答
  • 2020-12-18 10:28

    Victor Hurdugaci's answer should be upvoted, this here just provides some more information in case you need it.

    There seems to be a tooling issue at the moment when you have installed both the x86 and x64 .NET Core versions (More on this here: 32 bit not in good state and workarounds and the links).

    Setting "buildOptions" to "platform": "x86" and "runtimes": to "win7-x86" in project.json is not working (the x64 directory can still get created during built depending on the PATH environment variable).

    This will hopefully get fixed after they switch from project.json to .csproj (why they change it here: Changes to Project.json).

    At the moment when you have installed both versions like this (.NET Framework Downloads):

    You need to set the order in the path environment variable:

    So that the one you want to use appears first and then (re-)start Visual Studio.

    To check which dotnet is currently "active" run: dotnet --info in the console.

    0 讨论(0)
  • 2020-12-18 10:43

    This is what worked for me :

    An hour ago, visual studio 2015 team released a new update labeled "Microsoft Visual Studio 2015 Update 3 (KB3165756)"

    After installation, everything works as expected.

    A big thanks to MS and .net core / vs2015 teams for this extremely timely release :)


    Addendum:

    Installing the update isn't enough ( although I suspect it is part of the fix ). The additional steps to make this work you need to follow @VictorHurdugaci directives:

    1. Ensure you have installed the x86 version of the .net SDK

    2. And ensure PATH order of "C:\Program Files (x86)\dotnet\" before "C:\Program Files\dotnet\" the runtime which is not guaranteed when you install the new package ( I wanted to keep both x86 and x64 runtimes )

    Thanks VictorHurdugaci, at the end of the day you were absolutely correct.

    0 讨论(0)
  • 2020-12-18 10:46

    There are 2 options:

    1. (global) Uninstall the 64 bit .net SDK and install the 32 bit one. Restart VS afterwards.
    2. (local) Put a new .net SDK in a different folder and add from a console that path to your PATH. Then start VS from there. It will pick the first dotnet it finds on the PATH.
    0 讨论(0)
提交回复
热议问题