walter33
walter33

Reputation: 1019

.razor.g.cs could not be found

I am posting a hint how to overcome issue .razor.g.cs could not be found.

The fix is quite simple: shortening path to MyComponent.razor to make sure that complete path to MyComponent.razor.g.cs is shorter than 255.

I have experienced this issue with Source file c:\......\very long path\obj\Debug\net5.0\RazorDeclaration\Pages\MyComponent.razor.g.cs could not be found and complete path was 262 chars, so I just renamed component for example to 'Short.razor' and the error is gone.

Upvotes: 2

Views: 1377

Answers (1)

walter33
walter33

Reputation: 1019

The fix is: shortening path to MyComponent.razor to make sure that complete path to MyComponent.razor.g.cs is shorter than 255.

Upvotes: 3

Related Questions