Open inf9144 opened 4 years ago
@inf9144 thanks for contacting us.
@pranavkm do we support Link on razor files?
Given the error is from the default project system which the compiler does not use, my guess is that dotnet build
would work, but tooling is busted. Is that the case @inf9144?
/cc @NTaylorMullen \ @ajaybhargavb \ @ryanbrandenburg
Indeed dotnet build and dotnet publish work - just problematic with Visual Studio. Got another problem on publish via Visual Studio: Not all files and directories are created. As example _framework/_bin is missing.
In case it helps: Building with MSBuild using the vs solution file does work too.
It is not only for WASM, linked *.razor files in Page folder do not work for standard server version either.
I have solution with server and WASM projects sharing common files, using links. That works for .cs files in root of projects, but does not work for Pages/.razor files.
What works:
What does NOT work is:
Just to add that it does not work for linked files under wwwroot either ( css or js files for example )
So far it only worked with linked cs files in root folder of the projects.
I'm having this problem too when deploying a Nuget I made, which includes razor components shipped as files (not compiled in a dll). Because the nuget files are included in the user project as links, VS goes nuts and throws exceptions telling me the razor files are not descendents of the base path. I also ship a .cs file as part of this Nuget and this one works no problem.
hello guys,
we are just having the same issue with a linked cshtml file.
We are using this kind of tree:
Inside the Project_Shared there is the _layout.cshtml and _layout.cshtml.cs, that we've linked in project1 and project2. When we try to edit the _layout.cshtml from the two projects 1-2 we get the same error
System.InvalidOperationException: The file X is not a descendent of the base path Y in Microsoft.AspNetCore.Razor.Language.DefaultRazorProjectFileSystem.GetItem(String path, String fileKind)...
Anyway compile just fine and run without issue, only intellisense in visualstudio is broken.
Our project setup for all our C#-Projects is splitted in different csproj files and folders like this:
.\Base\B\C\D\SomeProjectBase.csproj
.\CustomerFolder\B\C\D\SomeProject.csproj
NonBase does import base project file. So all our razor files from the base code are somwhere under.\Base\B\C\D\**\*.razor
and the others are under.\CustomerFolder\B\C\D\**\*.razor
when i now open some razor file of the base folder i get the following error and intellisense does not work: "The file X is not a descendent of the base path" Why would it need to be a descendent of the base path? Thats a huge problem for our project toolchain.Addtional infos: We set the following properties:
The razor files are included like this: