0
votes

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'.

1
For further information about your second error add you source code in your question.Govinda Rajbhar

1 Answers

1
votes

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.