0

I have what I think is a fully up-to-date installation of Visual Studio 2015 Update 3.

If I create a new solution using the "ASP.NET Core Web Application (.NET Core)" template, then select the "Web Application" ASP.NET Core Template with "No Authentication" and wait for it to finish restoring packages, then viewing Razor source files with Tag Helpers shows them in bold purple. A good example is Views\Shared_Layout.cshtml:

screenshot of _Layout.cshtml showing bold purple tags

However, if I attempt to upgrade it to .NET Core 1.1 following the instructions at the .NET Web Development and Tools Blog then the design-time TagHelper support is lost:

screenshot of _Layout.cshtml showing un-decorated tags

Also missing is all TagHelper Intellisense.

I have SDK version 1.0.0-preview2-1-003177 installed and referenced in the global.json:

{
    "projects": [ "src", "test" ],
    "sdk": {
        "version": "1.0.0-preview2-1-003177"
    }
}

And the project.json looks like this:

{
    "dependencies": {
        "Microsoft.NETCore.App": {
            "version": "1.1.0",
            "type": "platform"
        },
        "Microsoft.AspNetCore.Diagnostics": "1.1.0",
        "Microsoft.AspNetCore.Mvc": "1.1.0",
        "Microsoft.AspNetCore.Razor.Tools": {
            "version": "1.1.0-preview4-final",
            "type": "build"
        },
        "Microsoft.AspNetCore.Routing": "1.1.0",
        "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
        "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
        "Microsoft.AspNetCore.StaticFiles": "1.1.0",
        "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
        "Microsoft.Extensions.Configuration.Json": "1.1.0",
        "Microsoft.Extensions.Logging": "1.1.0",
        "Microsoft.Extensions.Logging.Console": "1.1.0",
        "Microsoft.Extensions.Logging.Debug": "1.1.0",
        "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
        "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0"
    },

    "tools": {
        "BundlerMinifier.Core": "2.0.238",
        "Microsoft.AspNetCore.Razor.Tools": "1.1.0-preview4-final",
        "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final"
    },

    "frameworks": {
        "netcoreapp1.1": {
            "imports": [
                "dnxcore50"
            ]
        }
    },

    "buildOptions": {
        "emitEntryPoint": true,
        "preserveCompilationContext": true
    },

    "runtimeOptions": {
        "configProperties": {
            "System.GC.Server": true
        }
    },

    "publishOptions": {
        "include": [
            "wwwroot",
            "**/*.cshtml",
            "appsettings.json",
            "web.config"
        ]
    },

    "scripts": {
        "prepublish": [ "bower install", "dotnet bundle" ],
        "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
    }
}

So, what am I missing?

I see there is a similar Issue against the Razor tooling at Github

Razor Tag Intellisense disappears

I do hope there is a resolution...

Alasdair C-S
  • 320
  • 2
  • 10
  • 1
    http://stackoverflow.com/questions/40825116/tag-helper-intellisense-not-working-after-upgrading-from-asp-net-core-1-0-to-1-1 – Alexan Jan 25 '17 at 19:55
  • You can try to add two items about ‘Microsoft.AspNetCore.Razor.Tools’ into your project.json, please check this similar issue: https://github.com/aspnet/Tooling/issues/880 and the reply from RemyArmstro may be helpful for your issue. – Sara Liu - MSFT Jan 26 '17 at 08:32
  • @Sara-MSFT - I already have "Microsoft.AspNetCore.Razor.Tools" in both the "dependencies" and "tools" sections, and still no dice :-( – Alasdair C-S Jan 26 '17 at 09:39

1 Answers1

1

I came in the morning and the demo project was working as expected. After some head-scratching, I think it's because I forgot to clean and re-build my demo project. I may look like a doofus, but it's a salutatory tale so I'm leaving it here for posterity.

For the record, you certainly do need to reference the Razor tooling twice in project.json:

"dependencies": {
    "Microsoft.AspNetCore.Razor.Tools": {
        "version": "1.1.0-preview4-final",
        "type": "build"
    }
},
"tools": {
    "Microsoft.AspNetCore.Razor.Tools": "1.1.0-preview4-final"
}

:slinks off in shame.

Alasdair C-S
  • 320
  • 2
  • 10