Base solution for your next web application
Open Closed

ASP.NET Core Framework Template Won't Run #2427


User avatar
0
twigman08 created

I wanted to try out and get my hands dirty with the ASP.NET Core framework template in hopes of using it a little later down the road. So after creating test project template with it and running the default project I see that it will not run for me.

I click run and as it tries to load everything in I get the following Exception:

An exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll and wasn't handled before a managed/native boundary

Additional information: Could not load file or assembly 'System.IO.FileSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

This is with the default project template. The only thing changed was updating the connection string to point to my local instance of SQL Server.

I have: .NET Core 1.1 SDK Installed Visual Studio 2015 Update 3 Visual Studio .NET Core Tools installed (Preview 2)

I have tested and successfully ran the default Visual Studio .NET Core and ASP.NET Core Templates to be sure that I can actually run .NET Core apps no problem.

Any help would be greatly appreciated with this. If you need more information then just let me know. Thanks!


12 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Did you find a solution for this ?

  • User Avatar
    0
    twigman08 created

    Hey, sorry for the late reply.

    I have yet to find a solution for this. I just tried again on another brand new template and it still will not run. The error is now different though:

    New Error:

    FatalExecutionEngineError occurred
      HResult=-2146233082
      Message=Exception of type 'System.ExecutionEngineException' was thrown.
      InnerException: 
    Additional Information: The runtime has encountered a fatal error. The address of the error was at 0x72091a09, on thread 0x231c. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
    

    This exception is thrown in the Configure method in the Startup class where ABP Framework is initialize (app.UseAbp())

    The only difference in my machine since then is that I updated Visual Studio 2017 which I believe did have an update for .NET Core.

    I was about to post something on GitHub in hope to garner more attention and discussion on this to see if we can get this solved.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Can you try to set version of dotnet sdk in your global.json. Please see this issue for that <a class="postlink" href="https://github.com/dotnet/cli/issues/5626#issuecomment-278498597">https://github.com/dotnet/cli/issues/56 ... -278498597</a>.

    After installing VS 2017, VS 2015 tries to use dotnet sdk 1.0.0 rc4 and it does not support this project model. Setting dotnet sdk version worked for me.

  • User Avatar
    0
    twigman08 created

    Thanks for that link. I updated my global.json file to have it use the preview2 CLI version. When I went to run it it went back to throwing the original exception that I described in the original post. So pretty much I am back to the original issue of still not being able to run the default Core Template will nothing changed to it.

    Exception:

    System.IO.FileLoadException was unhandled
    Message: An exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll and wasn't handled before a managed/native boundary
    Additional information: Could not load file or assembly 'System.IO.FileSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Have you tried to run this project on another machine ? If you have the same error, can you send the downloaded project to info@aspnetzero and we will try to run it on our development machines.

    Thanks.

  • User Avatar
    0
    twigman08 created

    I have not yet gotten to try it on a different machine. I won't be able to try that until Tuesday. I will try it then and then get back with you to let you know of the results.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @twigman08,

    Will be waiting for your response.

  • User Avatar
    0
    twigman08 created

    Ok so this computer didn't have Visual Studio update 3 or the .NET Core Tools for Visual Studio 2015 so I went through that process, so this test was done on a pretty much clean machine for .NET Core.

    After trying to run the default template it started up and run without any problem. Intriguing. So this does lead me to believe it's an issue on the other computer though I can't figure out what it is. I have all dependencies. Hmm...I am really confused now what it could be. Especially because the first time it didn't run I uninstalled all my .NET Core stuff to start from the beginning (just like I had to do with this).

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Thanks for your test. Actually I have also installed VS 2017 and faced a similar problem but defining dotnet sdk version in my global.json to something "1.0.0-preview2-****" and close&open the solution after this step solved teh problem for me.

    Can you check do you have any preview2 sdk installed on your computer in this folder "C:\Program Files\dotnet\sdk" ?

    Thanks.

  • User Avatar
    0
    twigman08 created

    I do. One thing I noticed is that the project seems to want to use the 32-bit versions. Under Programs Files (x86) I have a "1.0.0-preview2-1-003177"

    Under Program Files/dotnet/sdk I have both "1.0.0-preview2-1-003177" and "1.0.0-preview2-003131"

    Does that sound right or is something off? If I try to use the "1.0.0-preview2-003131" one in my global.json file it complains that it can't find that SDK version in my Programs Files(x86) folder.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    I think this is normal, VS chooses x86 version when both exists but I'm not %100 sure about it. What happens when you use 1.0.0-preview2-1-003177 ?

    By the way I don't have x86 version of dotnet sdk, maybe this is causing the problem for you.

  • User Avatar
    0
    twigman08 created

    When I try using the 1.0.0-preview2-1-003177 I get the error from the original post:

    System.IO.FileLoadException was unhandled
    Message: An exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll and wasn't handled before a managed/native boundary
    Additional information: Could not load file or assembly 'System.IO.FileSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    

    I also went and removed the x86 version of the dotnet SDK and I still receive the same error. Later this weekend I may try from and remove all of the dotnet sdk and install everything again just to see what happens. As I am pretty confused as to why I can't run this template but pretty much any else that is dotnet CORE I can build and run without any issues (in both VS 2015 and VS 2017 RC).