Efcore: PMC: dotnet exec needs a managed .dll or .exe extension

Created on 13 Dec 2016  路  5Comments  路  Source: dotnet/efcore

Sometimes on VS2017 (haven't figured out why yet), the NuGetPackageRoot property goes missing on the new .NET Core projects. This results in the following error.

dotnet exec needs a managed .dll or .exe extension. The application specified was 'bin\Debug\netcoreapp1.0\ConsoleApp1.runtimeconfig.json'

I've mitigated this in the feature work nightly builds, but we should try to get to the bottom of it.

closed-fixed type-bug

Most helpful comment

You can probably add the following inside a PropertyGroup to make it work on the NuGet releases.

<NuGetPackageRoot>$(USERPROFILE)\.nuget\packages\</NuGetPackageRoot>

All 5 comments

I just had this issue with VS 2017 on the 12.12.2016 update. What I do not get is that the one week-old project (under the previous release of VS 2017 RC) still runs fine, but I get the error you mention with add-migration in the package manager console for a new .Net Core Console. I assume there is no workaround (?) for now.

I hit the same issue.

  1. Clean install of VS 2017 RC (15.0.26009.0)
  2. Create new console app (.Net Core)
  3. Install EF.SqlServer (1.1.0) & EF.Tools(1.1.0-preview4-final) package using PMC.

PM> Add-Migration --help
dotnet exec needs a managed .dll or .exe extension. The application specified was 'c:\users\smpatel\documents\visual studio 2017\Projects\ConsoleApp1\ConsoleApp1\bin\Debug\netcoreapp1.0\ConsoleApp1.runtimeconfig.json'
Process finished with non-zero exit code

build is successful and generates the dll.

1>------ Build started: Project: ConsoleApp1, Configuration: Debug Any CPU ------
1>ConsoleApp1 -> c:\users\smpatel\documents\visual studio 2017\Projects\ConsoleApp1\ConsoleApp1\bin\Debug\netcoreapp1.0\ConsoleApp1.dll
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

@bricelam - would preview4 package work in .net core & VS 2017?

It might, but you should be using 1.0.0-msbuild2-final (or the aspnet-feature-work nightlies) on VS 2017.

I'm running into the same issue, is there a workaround?

You can probably add the following inside a PropertyGroup to make it work on the NuGet releases.

<NuGetPackageRoot>$(USERPROFILE)\.nuget\packages\</NuGetPackageRoot>
Was this page helpful?
0 / 5 - 0 ratings