Specifically the error occurs in the Resources.Designer.cs
:
Error 2 The namespace \'ModulusFE\' already contains a definition for \'Sto
I came across a similar problem. After generating my database from an edmx file, I clicked 'save all' and 'build' and all the Types/Model classes that I created showed up in the error box. I researched why this happened and like your replies suggest, I thought it was something that was auto-generated.
However, solutions like deleting the auto-generated classes and re-generating them didn't work for me.
I eventually ran out of patience and decided I'd fix it another way. Since my script was saved, I just deleted the edmx file (and its reference in the web.config) and went back and created another one using "model from database" and didn't touch it after that.
Needless to say, I was pretty mad that it turned out like that.
look this happend to me when I created new file inside a folder with the same name of class in the project { folder name : Folder } and there is class name { Folder } so the namespace was the namespace.Folder so that the compiler assume that the cass defined in two places
in new file :
namespace APP.Folder
{
partial class NewFile
{
// ....
}
}
in the other file (the file that hase the problem):
namespace APP
{
partial class Folder
{
// ....
}
}
-- so you can edit the folder name or remove the .Folder from the namespace at the new file
I had this happen to me about a year ago and I don't remember exactly what the root cause was, but there are two things you might try:
Show All Files
in the Solution Explorer or open the solution folder in Windows Explorer - it could be that a version of the file somehow got excluded from the project and is therefor 'invisible' to VS but still makes it angry...If you are using different aspx.cs files that define classes of the same name you can use
<compilation targetFramework="4.5" />
under <system.web>
in your web.config file.
Although I would still strongly advise that you would change the class name.
If you copy&paste your pages don't forget to rename class names. Otherwise you get this error also with "Type already defines a member called 'OnGet' with the same parameter types"