-
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
The namespace *namespace* Already contains a definition for *Controller* #1402
Comments
I will throw in a temp fix as well: restart vscode. |
Invoking the "Restart OmniSharp" command will also fix it as a workaround. |
This is probably a special case of #785. |
I think what i did the first time i encountered it was to name the file something like "Particle", and the class "ParticleController" - i then renamed the file, and it gave this error. Altough i couldnt reproduce this scenario. |
Not sure if it is related to this issue, but I was playing with xUnit (install, uninstall, create diff project within the same solution, removed old xUnit, etc..). dotnet info:
|
It happened again. I just moved the entire solution into another file:
To:
and the same error |
cc @rchande |
Any solution other than restarting OmniSharp? This is not critical but really annoying since OmniSharp needs a reasonable amount of time to restart on larger solutions. |
For me it worked, when I opened VSCode as Admin(right click, Run as Administator ) |
Restarting Omnisharp worked for me. Press CTRL + SHIFT + P, then select 'Restart Omnisharp' from the list |
In this week, I'm getting this error frequently. But I'm not sure, when or why it is happening. 🤔 |
Since recently i get the same error/behavior for every new file with a new C# class i create. The moment i finish my Adding another new class in the already existing file after restarting Omnisharp does not trigger the error again. Edit: Just realized that renaming the file after everything was fine brings back the same error. |
Had the same issue. Restarting the VS Code has fixed it. |
It seems to happen when I connect my account for VSCode -- I use GitHub account. What's weirder is, after connecting/disconnecting the account, I have to test and restart VSCode twice or thrice for the problem to happen/not happen. My test involves creating a .cs file then creating a class in that file. I'm still trying to figure out if it has something to do with syncing OmniSharp settings. |
This happens every time I create a new class in a new file. Restarting OmniSharp works but it gets tedious really quickly. So I've had to resort to workarounds like creating my classes in bulk before restarting and putting related ones in the same file. v1.25 |
FWIW I was able to resolve the issue via the option |
Every time I create, move, rename a class, interface etc. this happens... to be able to work I have to restart omnisharp 50 times a day.... |
This issue does not happen if a new .cs file is added from elsewhere, not from Visual Studio Code. |
anybody still getting the same error in vs code 1.79 ? |
I was not able to quickly reproduce the problem again today. But had to manually switch to use OmniSharp first. VS Code About:
|
We've made lots of updates to the C# extension since this issue was filed. Please file a new issue if you're still experiencing this with updated logs. |
From @Cnordbo on April 18, 2017 19:52
Steps to Reproduce:
Error:
Says that it already exists, and shows an error in the UI
Copied from original issue: microsoft/vscode#24970
The text was updated successfully, but these errors were encountered: