0

I always get this error:

Could not load type System.Runtime.CompilerServices.ExtensionAttribute from assembly mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

whenever I run source code in VS 2010. But this error doesn't appear if VS 2010 is closed or computer is restarted. I use VS 2010 and target framework 4.0. I always face this trouble when I run source.

I have another error together with the above error. When I click menu in my application, I get often this error:

The requested script resource 'Common.Common.js' requires version 'AjaxControlToolkit,Version=4.1.40412.0, Culture=neutral, PublicKeyToken=28f01b00e84b6d53e' of the ASP.NET AJAX Framwork. To use this resource, make sure that the application references version 'AjaxControlToolkit,Version=4.1.40412.0, Culture=neutral, PublicKeyToken=28f01b00e84b6d53e'.

halfer
  • 19,824
  • 17
  • 99
  • 186

1 Answers1

1

Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly mscorlib

Yes, this technically can go wrong when you execute code on .NET 4.0 instead of .NET 4.5. The attribute was moved from System.Core.dll to mscorlib.dll in .NET 4.5. While that sounds like a rather nasty breaking change in a framework version that is supposed to be 100% compatible, a [TypeForwardedTo] attribute is supposed to make this difference unobservable.

For more information refer stackoverflow

I hope it will help you.

Community
  • 1
  • 1
Govinda Rajbhar
  • 2,926
  • 6
  • 37
  • 62
  • I have already used target framework 4.0 and can run successfully other computers. But I can't run on my computer. Can I install framework 4.5 in project that run with framework 4.0 ? – kyatmoutpin Mar 03 '14 at 07:39
  • Dear Sir, I don't understand clearly what you mean. I understand that AjaxControlToolkit have already included in .net framwork 4.0 . But I don't know how to fix these errors. Please help me. – kyatmoutpin Mar 05 '14 at 04:17
  • @kyatmoutpin your error is defining that you have need to include AjaxControlToolkit Version=4.1.40412.0.because you want to you commaon.comman,js which is in AjaxControlToolkit Version=4.1.40412.0.so follow this link and download this version of AjaxControlToolkit.http://ajaxcontroltoolkit.codeplex.com/releases/view/43475 – Govinda Rajbhar Mar 05 '14 at 05:31
  • And see this stacoverflow answer also it may help you.http://stackoverflow.com/a/5192453/2798643 – Govinda Rajbhar Mar 05 '14 at 05:33
  • if you are using `` in your source code at design side then try to change it as follow ` ` and follow this link for reason why you have need to change your source code.http://blog.thinkoriginally.com/2010/05/03/microsoft-jscript-runtime-error-ajaxcontroltoolkit-requires-asp-net-ajax-4-0-scripts/ – Govinda Rajbhar Mar 05 '14 at 05:38