Skip to content

Shared namespace in Razor Page broke 'dotnet build' and VS2017 #3178

Closed
@fe-c

Description

@fe-c

Using this at Razor Page markup @using Shared.Helpers
resolves as "App.Shared.Helpers" in Visual Studio and as "App.Pages.Shared.Helpers" with "dotnet build".
This causes such effects:
(some of them I can reproduce only on real project)

  1. Sometimes VS can build and run application, sometimes not.
  2. Sometimes VS shows error, sometimes not.
  3. Sometimes VS can run app with showing error, sometimes it can't run without error.
  4. Sometimes VS can build project, but can not launch it.
  5. "dotnet build" always show error.

Error is "The type or namespace name 'Helpers' does not exist in the namespace 'App.Pages.Shared' "
May be I use wrong using directive and it's VS issue.

.Net Core SDK: dotnet-sdk-2.1.300-win-x64
VisualStudio 15.7.2
TestApp.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: By DesignResolved because the behavior in this issue is the intended design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions