2

I cannot deploy my asp.net 4.5 website because I am getting multiple dreaded "The type 'myClassX' exists in both C:\Users\Me\...\whereItsSupposedToBe\ and C:\Users\Me\AppData\Local\Temp\Temporary ASP.NET Files\root\1randomname\_shadow\2randomname\3randomname\App_web_myClassX.cs.4acf3bb.nommceoi.dll errors.

There are three files involved. MyClasses.cs contains definitions for MyClassB, MyClassC, MyClassD. Page1.aspx and page2.aspx include in their <%page %> tag a src attribute for MyClasses.cs.

I have so far done the following:

  • cleaned the solution and project
  • shut down VS12
  • deleted the root\1randomname directory and emptied the recycling bin
  • restarted the #^$@ing computer
  • deleted the offending files, cleaned and built, created new files and renamed all involved filenames, classes and namespaces (oh yeah, they all used to be'myOGClassA'....)
  • introduced dummy variables hoping that would change the dll
  • deleted the bin and obj directories
  • added the batch="false" attribute to the compilation element of the web.config file as mentioned here: ASP.Net error: "The type 'foo' exists in both "temp1.dll" and "temp2.dll"

Something makes me wonder if having two of the aspx files having references to the same src file has something to do with it. But in all the blogs and SO posts Iv seen so far that would result in the conflicts both coming from the temp directories.

Head starting to hurt... Any suggestions?

Community
  • 1
  • 1
Robbie
  • 445
  • 5
  • 13
  • move this file in temporary to another location and try executing. C:\Users\Me\AppData\Local\Temp\Temporary ASP.NET Files\root\1randomname\_shadow\2randomname\3randomname\App_web_myClassX.cs.4acf3bb.nommceoi.dll – Shiva Saurabh Feb 21 '14 at 07:00
  • @Saurabh if I move the file it makes no difference. If I delete the file it makes no difference. The files creating the conflicts keep getting generated. No amount of cleaning or manual deleting seems to help. – Robbie Feb 21 '14 at 18:43
  • Try changing your class name.. check if its also repeating in temporary folder – Shiva Saurabh Feb 22 '14 at 07:50

1 Answers1

0

I have "fixed the problem" but I am not sure why it is fixed.

To recreate the problem:

  1. Create a New Project -> ASP.NET Web Forms Application.
  2. Create a new folder ("Search").
  3. Add the three files from the demo project zip found at Static-Site Search Engine with ASP.NET/C# by craigd (Searcharoo version 1). These files are Searcharoo.cs, SearcharooCrawler.aspx, and Searcharoo.aspx.
  4. Take a look at SearcharooCrawler.aspx. At this point I get the 'exists...' errors. If you still do not see errors, view the project in the browser. The errors seem to appear as you are looking at the .aspx files in VS12.

To fix:

  1. Create a new folder ("Happy_App")
  2. Move Searcharoo.cs to the new Happy_App. This fixes the 'exists...' errors, but now Searcharoo.cs 'can't be found' so...
  3. Delete the 'Src="Searcharoo.cs"' attribute from the top <%paging...%> tag in both aspx files. I believe that this Src attribute is no longer used in ASP.NET 4.5 (I may be wrong)
  4. View in browser and navigate to the Search/SearcharooCrawler page. No errors! (need to add a few properties in web.config to get the searcharoo demo working, but thats not the point of this post...)

But the truly weird part - I found that after moving the Searcharoo.cs file to the Happy_App folder I could move it back the original Search folder without any 'Exists' problems!

Why??

If anyone has an explanation that would be awesome. But for now I'm happy I could get a resolution without sacrificing a small animal...

Robbie
  • 445
  • 5
  • 13