-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename .cs file -> The namespace 'Namespace' already contains a definition for 'ClassName' [netcoreapp1.0] #785
Comments
I had this same issue, see #803. |
Experienced same issue. |
Same error occuring for me - rename a .cs file and get the errors mentioned above. Need to restart VS Code to fix. |
This is fixed with the latest beta v1.13.0-beta4. You can install it by following the instructions here. |
This is fixed only in beta? because I am still facing this issue with v1.13. |
Yes, this was fixed in 1.13. @rchande? |
@ehajri It should be fixed. Can you provide more information about what's happening to you? |
@DustinCampbell, @rchande I removed the extension and it appears to be 1.13.1 now. |
Thanks for the update @ehajri. I've seen some evidence of strange install issues with VS Code 1.18 that seem to "correct" themselves later. Hopefully, that's all this was. |
I'm having this problem using C# extension 1.13.1 (and VSCode 1.19 Insiders) in a particular scenario. Steps
I get a squiggly line on the classname for the same "Namespace already contains a definition" error. EDIT: |
Odd, but I experienced this today, too. Restructuring my project directory triggered this. Restarting VSCode fixed it. |
@johncrisostomo What extension version are you on? |
Had the same issue today. VS Code info
OmniSharp
Workaround Case
|
code --version code --list-extensions --show-versions i also changed i think i was using a default(older) omnisharp version but this didn't solved the issue the issue appears ONLY if i work with vscode workspace, steps to reproduce:mkdir test wait for omnisharp to complete to load and process the project select it and rename it "class2.cs" you'll see that a red squiggle appear below as i said if i open the folder with "code . " instead of using the workspace file the issue didn't appear. I hope this help to understand where the issue is, it is really annoying to keep restarting omnisharp |
@PhotoAtomic Oh, you might be on to something. If I open a single folder, I can rename without issue, but if I then add another folder (if that has any importance, via the side pane Explorer -> Right-Click -> Add Folder to workspace), then error will appear on renames. |
This worked for me. |
This works, thanks for sharing! |
The same issue here, And restart vs code or Omnisharp doesn't work for me. So odd |
Running a VS Code with admin rights "helps". |
3 years later, still have to restart omnisharp after a file rename. Supporting these "advanced" use cases must be real hard. |
Original bug is still present. Also reproducible on copying and pasting a file containing a class. And as of today, reproducible on adding a new file and adding a new class. Looks like latest stable: |
The same issue. code --list-extensions --show-versions lsb_release -a |
Same issue... getting tired of omnisharp, many years and no solution. Considering transition my development team to Visual Studio. Project using .NET 6 and .NET 7 |
Still no solution for this? It happens to this very day.
|
I downgraded C# add-on to v1.24.1, and it is a workaround. |
Environment data
dotnet --info
output:VS Code version: 1.5.3
C# Extension version: 1.4.1
Steps to reproduce
The namespace 'Namespace' already contains a definition for 'ClassName' [netcoreapp1.0]
. Methods haveType 'ClassName' already defines a member called 'MethodName' with the same parameter types [netcoreapp1.0]
The text was updated successfully, but these errors were encountered: