3

Attempt by security transparent method 'System.Web.WebPages.Administration.SiteAdmin.RegisterAdminModule()' to access security critical method 'System.Web.WebPages.ApplicationPart..ctor(System.Reflection.Assembly, System.String)' failed.

I am getting this error, quite often. I am working on MVC5, .Net framework 4.5. I build the solution, and run the application it runs fine. I make some changes in code, build and then run the application, it runs fine. Then again i change some code and run, it give me this error.

I cant figure out the reason, because it occurs randomly at any time.

I also googled, and found that change the web.config and edit the debug flag or edit some other config sections.

The problem is it runs for few times and then give this error.

I am using Windows 8, MVC version 5.1.0.0 dll

[Update]: Uploading screenshot of call stack. Error stack

mehul9595
  • 1,925
  • 7
  • 32
  • 55
  • And what code are we talking about? – Patrick Hofman Mar 31 '14 at 11:26
  • It doesn't seem specific to code. It occurs randomly. – mehul9595 Mar 31 '14 at 11:28
  • What is the call stack? – Patrick Hofman Mar 31 '14 at 11:31
  • 1
    The suggestions in [this question](http://stackoverflow.com/questions/12092435/system-methodaccessexception-attempt-by-security-transparent-method-to-access-s?rq=1) didn't help? – rene Mar 31 '14 at 11:52
  • Nope. Still the same... occurs randomly. – mehul9595 Mar 31 '14 at 12:58
  • possible duplicate of [Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()'](http://stackoverflow.com/questions/17926552/attempt-by-security-transparent-method-webmatrix-webdata-preapplicationstartcod) – Levi Mar 31 '14 at 16:22
  • 5
    Did you ever figure this out, this question has had 638 views, and I am getting this same error but it is not intermittent. – Brian Ogden Sep 12 '14 at 05:50
  • "The delete extra files check box in the publish dialog solved it for me." Reference: http://stackoverflow.com/questions/17926552/attempt-by-security-transparent-method-webmatrix-webdata-preapplicationstartcod – Brian Ogden Sep 12 '14 at 06:06
  • Nope couldn't get it fixed so far i've already checked that link. – mehul9595 Sep 12 '14 at 11:23

0 Answers0