1

I recently converted my website into a web application (pain in the behind). After everything was said and done and loaded all the libraries and fixed all the errors I decided to run it. I received the following error:

Compiler Error Message: CS0433: The type 'WebSite5.BundleConfig' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\dc09734f\e0cd1143\App_Code.f12uuiuu.dll' and 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\dc09734f\e0cd1143\assembly\dl3\f6c46402\e43f8fd6_b679cf01\WMEXEC.DLL'

Source Error:

Line 9:      {
Line 10:         // Code that runs on application startup
Line 11:         BundleConfig.RegisterBundles(BundleTable.Bundles);
Line 12:         AuthConfig.RegisterOpenAuth();
Line 13:         RouteConfig.RegisterRoutes(RouteTable.Routes);


Source File: c:\Users\usrsn\Documents\Visual Studio 2012\Projects\WMEXEC SLN\WMEXEC\Global.asax    Line: 11

I tried going into the folder and deleting everything as other posts have recommended and cleaned and rebuilt my solution and ran it again and I got the same error.

How can I resolve the error?

Si8
  • 9,141
  • 22
  • 109
  • 221
  • 1
    This can happen for a few reasons, but the most common to my knowledge is duplicate user control names and classes. You can't have two with the same name. You might want to go through and check your solution to see if there are any with the same name. – BobbyDazzler May 27 '14 at 14:52
  • I checked and rechecked and it doesn't look like I have any duplicate. How can I be sure? – Si8 May 27 '14 at 15:08

1 Answers1

1

Possible duplicate with ASP.Net error: "The type 'foo' exists in both "temp1.dll" and "temp2.dll".

Add the batch="false" attribute to the "compilation" element of the web.config file.

Community
  • 1
  • 1
user2316116
  • 6,726
  • 1
  • 21
  • 35
  • Thanks. That solved the issue. Now I get this error: `CS0103: The name 'AuthConfig' does not exist in the current context` in line `AuthConfig.RegisterOpenAuth();` – Si8 May 27 '14 at 15:14
  • Adding BATCH=FALSE causes the other CS files in my APP_Code folder to not work :/ – Si8 May 27 '14 at 15:19
  • That error cannot be answered without seeing the code. Most likely you have no AuthConfig class in your solution. If you don't need it - get rid of calling its method. Also I would suggest to create a brand new webproject in VS.NET and copy all code from website there. This should fix issues with missing references or other "website"-related issues. – user2316116 May 27 '14 at 15:29