Skip to content

Testing .NET Core project might fail with: "MyTests.exe isn't a .NET assembly" #63

@jcansdale

Description

@jcansdale

NOTE: When a "runtimes" element was defined in a .NET Core project, it was attempting to execute the native EXE shim rather than the target assembly DLL.

I'm seeing this error from a project like this:

{
  "version": "1.0.0-*",
  "buildOptions": {
    "emitEntryPoint": true
  },

  "runtimes": { "win10-x64": "" },

  "dependencies": {
    "dotnet-test-xunit": "2.2.0-preview2-build1029",
    "Microsoft.NETCore.App": "1.0.0",
    "StaticMocks": "0.8.0-beta-506",
    "xunit": "2.2.0-beta3-build3402"
  },

  "testRunner": "xunit",

  "frameworks": {
    "netcoreapp1.0": {
      "imports": "dnxcore50"
    }
  }
}

It appears that both of these files exist:

bin\Debug\netcoreapp1.0\win10-x64\ConsoleApp1.exe
bin\Debug\netcoreapp1.0\win10-x64\ConsoleApp1.dll

I expect the first one is a non-.NET shim EXE for bootstrapping .NET Core.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions