Build my asp.net 4.0 crashes

I 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 include the dll dll quartz.net in my bin directory on the Internet and reference it in the code. I am sure this is due to the wrong .net card.

My asp.net site uses target environment 4.0 I use .net 4 quartz.net files

and my IIS application pool (classic .net pool) is configured to run .net 4.0 frework.

I'm not sure where to start, but what I know for sure is to remove Quartz, and I look good again (minus planning)

+8
source share
3 answers

This was a problem that appeared in the final version, because Quartz.Net was compiled against framework 4.5. Take a look at this topic reporting a problem. Fixed version of dll is available.

+5
source share

The ExtensionAttribute class must use extension methods in C #. In the .NET Framework 4.0, this class is in the System.Core.dll assembly, but in the .NET Framework 4.5 the class has been moved to the mscorlib.dll file. I assume that the problem is that Quartz.dll (or some other assembly) was compiled on a computer with .NET Framework 4.5 installed, waiting for ExtensionAttribute in mscorlib.dll, which is not on computers with .NET Framework 4.0.

I believe that recompiling Quartz on a computer without the .NET Framework 4.5 should solve the problem. Also, installing the .NET Framework 4.5 on a server with IIS should help, but I would not recommend it, since it is still in beta.

+6
source share

Have you tried adding a reference to the mscorlib assembly and setting Copy Local to true?

Read here :

This issue is related to starting ILMerge.exe. Type redirection (in this case, ExtensionAttribute type) is considered an inextricable change in the sense that it is transparent, in a supported script, to the runtime, as well as to our compilers. Compilers or, as expected, compiler tools (of which ILMerge is one of) type will be used, just as they are expected to support other runtime functions. In addition, the supported way to run compilers by explicitly and fully referencing reference assemblies is the corresponding Multi-Targetting package.

+1
source share

All Articles