2

I renamed sln, csproj and namespace but am getting these three errors which I didn't have prior to renaming.

   /App.razor(66,66): Error CS0246: The type or namespace name 'MainLayout' could not be found (are you missing a using directive or an assembly reference?) (CS0246) 
  /obj/Debug/net5.0/Razor/App.razor.g.cs(155,155): Error CS1662: Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type (CS1662)
   /App.razor(37,37): Error CS0246: The type or namespace name 'MainLayout' could not be found (are you missing a using directive or an assembly reference?) (CS0246) 
2
  • 1
    Did you change the _Imports.razor file? Commented Feb 11, 2021 at 16:11
  • I did , I changed the namespace there Commented Feb 12, 2021 at 12:43

2 Answers 2

2

You could create a project template from within Visual Studio

enter image description here

This will let you "re-create" your project with a new name, it will keep everything you have but rename some namespaces to your new name.

Also helpful if you need to create "project templates" to be re-used in your organization

Sign up to request clarification or add additional context in comments.

Comments

0

I had the same problem until I renamed the namespace to match the project name

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.