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

前端 未结 10 546
悲哀的现实
悲哀的现实 2020-11-22 14:25

When starting up my web site for the first time, I\'m getting this error

Could not load type \'System.Runtime.CompilerServices.ExtensionAttribute\' from assemb

10条回答
  •  心在旅途
    2020-11-22 14:43

    In my case after downgrading from .NET 4.5 to .NET 4.0 project was working fine on a local machine, but was failing on server after publishing.

    Turns out that destination had some old assemblies, which were still referencing .NET 4.5.

    Fixed it by enabling publishing option "Delete all existing files prior to publish"

提交回复
热议问题