Description
I get an invalid operation exception in Visual Studio 2019 Preview, .NET Core 3 preview 4 when opening a .razor file. VS renders the text as white only and intellisense does not work.
When I check the error log:
System.InvalidOperationException: The file 'C:/Users/jerry/Desktop/vs/MetroLock/MetroLock/Pages/FetchData.razor' is not a descendent of the base path 'C:/Users/jerry/desktop/vs/MetroLock/MetroLock' ...
In the two paths, one of the "Desktop" is capitalized, the other is not. This is fixed by moving my project to a lower case only directory. I looked really quick at the file DefaultRazorProjectFileSystem.cs and one possible fix would be on line 53
if (!absolutePath.StartsWith(absoluteBasePath))
could be changed to:
if (!absolutePath.StartsWith(absoluteBasePath, StringComparison.OrdinalIgnoreCase))
I hope this helps,
Thanks!