C# Eto.Mac构建问题的表单和VS
我正在试验Mac版VS中的Eto.Forms。生成时,我收到以下错误: System.Reflection.TargetInputException异常 及 无法加载文件或程序集'Xamarin.Mac,版本=0.0.0.0, 区域性=中性,PublicKeyToken=84e04ff9cfb79065'或其 依赖关系 我认为这意味着我错过了一个参考资料。但是,Xamarin.Mac也不会显示在引用编辑器中。有人对我有什么想法或建议吗 当我在VS for Windows中运行它时,同样的解决方案工作得很好 添加的参考是系统、Eto和Eto.XamMac2,主要使用以下代码:C# Eto.Mac构建问题的表单和VS,c#,xamarin,xamarin.mac,visual-studio-mac,eto,C#,Xamarin,Xamarin.mac,Visual Studio Mac,Eto,我正在试验Mac版VS中的Eto.Forms。生成时,我收到以下错误: System.Reflection.TargetInputException异常 及 无法加载文件或程序集'Xamarin.Mac,版本=0.0.0.0, 区域性=中性,PublicKeyToken=84e04ff9cfb79065'或其 依赖关系 我认为这意味着我错过了一个参考资料。但是,Xamarin.Mac也不会显示在引用编辑器中。有人对我有什么想法或建议吗 当我在VS for Windows中运行它时,同样的解决方案
[STAThread]
public static void Main(string[] args)
{
var platform = Eto.Platforms.XamMac2;
new Application(platform).Run(new MyForm());
}
谢谢经过一番搜索,我发现为您设置了解决方案: 我缺少的依赖项是:
/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/Xamarin.Mac.dll您应该做的是创建一个Xamarin.Mac应用程序并将Eto.XamMac2添加到其中。这允许您调试应用程序,并将使用Xamarin.Mac工具正确绑定。以下是如何做到这一点(使用最新的VS for Mac):
var platform = Eto.Platforms.XamMac2;
new Application(platform).Run(new MyForm());