Skip to content

Razor The type or namespace could not be found. #1731

@ghost

Description

Hi.
I have an application (Service) targeting .NET 4.61 and trying to move to AspNetCore self host with WebListener.
I am trying to investigate the requirements by testing it out in a console application.
The project i crated is a normal Windows console application, i referenced all the required packages with nuget and created required Startup class and create and start the host with WebHostBuilder.
I dont have any project.json files in my project and adding it didn't help.

Application runs fine and i get Web Api calls and routing functioning correctly.
The only problem that i have is that when i try to access MVC web page the views are not created but i rather get an error page with dozen of errors such as

The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
Predefined type 'System.Object' is not defined or imported
The type or namespace name 'ViewFeatures' does not exist in the namespace 'Microsoft.AspNetCore.Mvc' (are you missing an assembly reference?)

Am i missing something ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions