2

I'm following this course to learn ASP.NET Core.

I did exactly as they did, I can type dotnet new and dotnet restore. I also installed the dotnetcore 1.0.1 SDK preview.

All seems fine, and I should be able to type

using Microsoft.AspNetCore.Http;

But the only things recognized after Microsoft are cSharp, visualbasic and win32?

Here is my project.json file:

 {
   "version": "1.0.0-*",
   "buildOptions": {
   "debugType": "portable",
   "emitEntryPoint": true
  },
  "dependencies": {},
  "frameworks": {
   "netcoreapp1.0": {
    "dependencies": {
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version": "1.0.1"
    },
    "Microsoft.AspNet.WebApi": "5.2.3",
    "Microsoft." **<< i cannt type AspNetCore here**
    },
   "imports": "dnxcore50"
   }
 }

There is no Microsoft."AspNetCore". The only things I do have starting with Asp are:

  • AspNet.Identity.Owin
  • AspNet.Mvc
  • AspNet.Providers.Core
  • AspNet.Razor
  • AspNet.SignalR
  • AspNet.Web.Optimization
  • AspNet.WebApi
  • AspNet.WebApi.Clients
  • AspNet.WebApi.Core
  • AspNet.WebApi.Cors
  • AspNet.WebPages
4
  • Which IDE or Editor you are using? Commented Oct 29, 2016 at 12:31
  • 1
    i'm using visualstudio code (as in the coarse) at the moment but same thing happens when i load the json as a project file in vs2015 Commented Oct 29, 2016 at 12:37
  • Type "Microsoft.AspNetCore and press CTRL+spacebar and check Commented Oct 29, 2016 at 15:50
  • 1
    it eventually worked, i think the problem is because its so new, it wasnt recognized when editing the json file when i typed but after giving the :"" for version selection, it did came up with the version. the code completion wasnt woking, not entirely sure how it got fixed, but for the record i had the machine reinstall aspnetcore sdk and restarted the machine Commented Oct 29, 2016 at 23:20

1 Answer 1

2

The code completion doesn't always work when editing the project.json file, especially if you're using a lighter editor like VS Code. (Sometimes it doesn't work even in full-blown Visual Studio).

If this happens, don't worry! You can still install any packages you need. Find packages by searching on NuGet and then edit the dependencies section like this:

"PackageName": "1.0.0"   # Version from package details on NuGet

Then, use the dotnet restore command within the project directory to pull down all the packages in project.json.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.