Error when using extension methods in C#

后端 未结 16 2745
夕颜
夕颜 2020-12-13 01:31

I came across an issue that makes me think there is bug in the 3.0 framework. When I try to use extension methods I get the following error:

Missing compile         


        
16条回答
  •  一整个雨季
    2020-12-13 02:16

    This problem is indeed caused by an incorrect reference to version 2 of System.Core . This is normally caused when upgrading from an earlier version of .NET to .NET 3.5 . If it is a website that you are experiencing this problem in then it can be remedied by following the steps below:

    1) In web.config add a reference to System.Core v3.5:

    
       
    
    

    2) In web.config add the following as a child of configuration:

    
       
       
          
             
             
          
       
    
    

提交回复
热议问题