2014-04-09 45 views
1

我想将VS2010项目导入MonoDevelop。我将它更新到版本4.3.0,所以我照惯例在MonoDevelop VS项目迁移错误

/usr/lib/mono/4.0/Microsoft.Common.targets: Warning: Unable to find framework corresponding to the target framework moniker '.NETFramework,Version=v4.0,Profile=Client'. Framework assembly references will be resolved from the GAC, which might not be the intended behavior. (SlkRepair)

作为警告。然而,我却遇到了这样的错误:

'SlkRepair/SlkRepair/SlkLib.cs(28,28): Error CS1110: 'SlkRepair.RegexEx.ContainsAny(this string, params char[])': Extension methods require 'System.Runtime.CompilerServices.ExtensionAttribute' type to be available. Are you missing an assembly reference? (CS1110) (SlkRepair)

ContainsAny函数的代码:

public static class RegexEx 
{ 
    public static bool ContainsAny(this string s, params char[] chars) 
    { 
     bool result = false; 
     foreach (char c in chars) 
     { 
      result |= s.Contains(c); 
      if (result) 
       break; 
     } 
     return result; 
    } 
} 

我的项目有这样的程序集引用:

  • 系统
  • System.Core程序
  • System.Data
  • System.Data.DataSetExtensions
  • 的System.Xml
  • System.Xml.Linq的

试图增加在参考文献编辑没有帮助 - 我无法找到它。 任何人都可以解释什么参考和我应该如何添加?我是MonoDevelop的新手。你需要首先解决的Visual Studio的侧

回答

2

两个问题是,

  1. 单不支持客户端配置文件。因此,请确保在Visual Studio中使用完整配置文件而不是客户端配置文件。

  2. 您使用的Mono运行时(不是MonoDevelop)似乎太旧而无法支持.NET 4.5,因此会发生ExtensionAttribute异常。至少你必须使用Mono 3.2.8。要检查您的Mono版本,只需在终端运行mono --version。如果您不使用任何4.5功能,也可以将项目降级到.NET 4。

+0

谢谢!不过,它确实是4.0,所以我只是把平台变成了完整版。它建立。 – Danatela