0

Someone please. Anyone. I've been fretting over this issue the last two days. I've read other issues that are similar. But they are not exact.

The error message is: The imported project

"C:\ProgramFiles\dotnet\sdk\1.04\Microsft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

I am trying to run an Angular2 ASP.NET core app developed using Visual Studio Express For Web 2015 that was working perfectly, before I installed Visual Studio 2017. I think the issues is the program is looking for a version of .NET core that somehow got removed. Here is my proj.json

{
  "userSecretsId": "aspnet-Angular2-b6820071-fb17-4201-b6fd-407054319783",

  "dependencies": {
    "Microsoft.NETCore.App": "1.0.0-rc2-3002702",
    "Microsoft.ApplicationInsights.AspNetCore": "1.0.0-rc2-final",
    "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-rc2-final",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final",
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0-rc2-
 final",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Razor.Tools": {
  "version": "1.0.0-preview1-final",
  "type": "build"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-final",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc2-final",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
  "version": "1.0.0-preview1-final",
  "type": "build"
},
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
  "version": "1.0.0-preview1-final",
  "type": "build"
},
  "tools": {
        "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview1-final",
      "imports": "portable-net45+win8+dnxcore50"
    },
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
      "version": "1.0.0-preview1-final",
      "imports": "portable-net45+win8+dnxcore50"
    },
    "Microsoft.EntityFrameworkCore.Tools": {
      "version": "1.0.0-preview1-final",
      "imports": [
        "portable-net45+win8+dnxcore50",
        "portable-net45+win8"
      ]
    },
    "Microsoft.Extensions.SecretManager.Tools": {
      "version": "1.0.0-preview1-final",
      "imports": "portable-net45+win8+dnxcore50"
    },
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
      "version": "1.0.0-preview1-final",
      "imports": [
        "portable-net45+win8+dnxcore50",
        "portable-net45+win8"
      ]
    }
  },
  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6",
        "dnxcore50",
        "portable-net45+win8"
      ]
    }
  },
  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },
  "runtimeOptions": {
    "gcServer": true
  },
  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "appsettings.json",
      "web.config"
    ]
  },
    "scripts": {
          "prepublish": [ "npm install", "bower install", "gulp clean", 
    "gulp 
    min" 
    ],
      "postpublish": [ "dotnet publish-iis --publish-folder 
%publish:OutputPath% 
--framework %publish:FullTargetFramework%" ]
    },
    "EntityFramework": "6.1.3",
    "Microsoft.EntityFrameworkCore": "1.1.1"
}

Here's a screenshot of the error message I receive when attempting to merely open the application:

enter image description here

And here is the error message in the console when attempting to run the program:

enter image description here

I'd appreciate your guidance. Thanks, CM

Chris Mazzochi
  • 179
  • 1
  • 15

1 Answers1

0

To continue using project.json based projects in VS 2015, you need to add a global.json file with the following contents at the solution level (directory hierarchy at or above project.json):

{
  "sdk": {
    "version": "1.0.0-preview2-1-003177"
  }
}

Replace 1.0.0-preview2-1-003177 with the latest 1.0.0 preview 2 version installed on your machine - you can find this version as a subfolder of C:\Program Files\dotnet\sdk.

Martin Ullrich
  • 94,744
  • 25
  • 252
  • 217
  • Hey Martin thanks for responding. I really need to resolve this. What exactly do I need to do. I tried inserting a global.json file at the solution level with the content you provided above and I received the "The project is configured to use .NET Core SDK version 1.0.0-preview2-1-003177 which is not installed" error message indicating that version wasn't installed which it isn't. But I then tried, "version": "1.0.0-preview2-1-003131", which is indeed installed, and received the same error message. In the project.json there is a dependency for "Microsoft.NETCore.App": "1.0.0-rc2-3002702", – Chris Mazzochi May 19 '17 at 11:54
  • update the project.json dependency to a non-prerelease version. 1.0.5 is the current one. – Martin Ullrich May 19 '17 at 12:03
  • I have 1.0.4 installed. Can I use that? If so, what would the updated project.json look like? I'd appreciate it. – Chris Mazzochi May 19 '17 at 12:20
  • 1.0.4 runtime? yes that works as well. just update the microsoft.netcore.app string and then use the VS integrated package management UI – Martin Ullrich May 19 '17 at 12:22
  • Alertnatively, use VS 2017 to create a new csproj-based project and add the source files to it. Or use the Migration included in VS 2017. The project.json tooling is deprecated and no longer supported – Martin Ullrich May 19 '17 at 12:22