3

I just checked out a .NET project to work on. However, when I run it, it gives me this compile error:

Compiler Error Message: CS0433: The type 'System.Web.Helpers.Json' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\2c3c3525\f643d2c6\assembly\dl3\a363418d\c830c6f0_9d86d001\System.Web.Helpers.DLL' and 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.Helpers\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.Helpers.dll'

Line 57: db.SubmitChanges(); Line 58: Line 59: Context.Response.Write(Json.Encode(new { success = true })); Line 60: Line 61: }

I tried to look for solution online but it didn't help. The steps I followed:

Manually deleting everything all the content inside the TEMP file adding batch="false" in compilation tag in the webconfig file

None of them helped... Anyone has any idea?

Dalorzo
  • 19,834
  • 7
  • 55
  • 102
ozimax06
  • 386
  • 3
  • 15
  • Can you please go to your web.config and find this "System.Web.Helpers" and share with us that section of your web.config? – Dalorzo May 22 '15 at 21:15
  • There is no System.Web.Helpers section in my WebConfig file: There is only System.Web and tags like protocols, pages, authentication etc.. But there is no System.Web.Helpers – ozimax06 May 22 '15 at 21:26
  • The only thing about System helpers in webconfig file is this – ozimax06 May 22 '15 at 21:40

1 Answers1

1

I had the same problem, and adding batch="false" in the <compilation /> tag of the web.config solved the problem.

Solution found here

Community
  • 1
  • 1
AlexB
  • 7,302
  • 12
  • 56
  • 74
  • this didn't work for me. I am migrating an old asp.net web site (asp.net 1 or 2?) to .net 4.5. I needed to move delegate event handler declarations to separate files. – marcel_g Mar 05 '18 at 17:25