Xamarin.ios xamarin组件无法解析程序集

Xamarin.ios xamarin组件无法解析程序集,xamarin.ios,mono,components,xamarin,.net-assembly,Xamarin.ios,Mono,Components,Xamarin,.net Assembly,我正在尝试构建一个xamarin组件。 我已经从绑定项目创建了一个SomeLibrary.dll。 使用此SomeLibrary.dll和组件模板( ),我已经生成了一个SomeLibrary-1.0.xam组件 我执行此命令将SomeLibrary组件安装到Xamarin Studio上(以便在将组件提交到应用商店之前对其进行测试): mono xamarin-component.exe安装/Users/somedeveloper/Desktop/xamarin组件/组件模板主控程序/Som

我正在尝试构建一个xamarin组件。 我已经从绑定项目创建了一个SomeLibrary.dll。 使用此SomeLibrary.dll和组件模板( ),我已经生成了一个SomeLibrary-1.0.xam组件

我执行此命令将SomeLibrary组件安装到Xamarin Studio上(以便在将组件提交到应用商店之前对其进行测试):


mono xamarin-component.exe安装/Users/somedeveloper/Desktop/xamarin组件/组件模板主控程序/SomeLibrary-1.0.xam

(推荐人)

现在,我正在尝试测试我的SomeLibrary组件。我创建了一个全新的项目,将组件添加到我的项目中,编写了几行使用SomeLibrary api的代码,在构建和运行时出现了以下错误。 我在这里感到迷茫和困惑,任何想法、建议都会很好。^^

我从错误中看到的主要内容是:


错误MT2002:未能解析程序集:“SomeLibrary,版本=0.0.0.0,区域性=中性,PublicKeyToken=null”

它似乎在抱怨某种公钥代币。这是什么?我是否必须为SomeLibrary组件生成PublicKeyToken?如果是,如何生成PublicKeyToken

感谢并感谢您的帮助、建议或评论

完整错误日志
构建:SomeLibraryComponent(调试| iPhone)
正在检测签名身份。。。
资源调配配置文件:XXXXXXXXXXXXXXXXXXXXXXXX
签名身份:“iPhone开发者:XXXXXXXXX(ALKJLKJSLDKJFLJ)”
应用程序ID:“SDLFJLKSDJF.SomeLibrarycomponent”
正在执行主编译。。。
/Library/Frameworks/Mono.framework/Versions/3.2.3/bin/mcs/noconfig”/r:/Developer/MonoTouch/usr/lib/Mono/2.1/mscorlib.dll“-nostlib”/out:/Users/somedeveloper/projects/SomeLibraryComponent/bin/iPhone/Debug/SomeLibraryComponent.exe”“/r:/Developer/MonoTouch/usr/lib/Mono/2.1/System.dll”“/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll”“/r:/Developer/MonoTouch/usr/lib/MonoTouch/2.1/System.dll”“/r:/Users/somedeveloper/projects/SomeLibraryComponent/Components/SomeLibrary-1.0/lib/ios/SomeLibrary.ios.dll”“/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll”“/r“/nologo/warn:4/debug:full/optimize-/codepage:utf8”/define:debug;\uuuuuu MOBILE\uuuuuu;\uuuuu IOS\uuuuu”/t:exe”/Users/somedeveloper/projects/SomeLibraryComponent/Main.cs”“/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/AppDelegate.cs”“/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponentViewController.cs”“/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponentViewController.designer.cs”
编译成功-1个警告
/用户/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/SomeLibraryComponentViewController.cs(48,24):警告CS0672:Member`SomeLibraryComponent.SomeLibraryComponentViewController.shoulldAutoRotateTointerFaceOrientation(MonoTouch.UIKit.UIInterfaceOrientation)'覆盖过时成员'MonoTouch.UIKit.UIViewController.ShouldAutorotateToInterfaceOrientation(MonoTouch.UIKit.UIInterfaceOrientation)'。将过时属性添加到'SomeLibraryComponent.SomeLibraryComponentViewController.ShouldAutorotateToInterfaceOrientation(MonoTouch.UIKit.UIInterfaceOrientation)'
/Developer/MonoTouch/usr/lib/mono/2.1/MonoTouch.dll(与先前警告相关的符号位置)
生成完成--0个错误,1个警告
编译为本机代码
/开发者/MonoTouch/usr/bin/mtouch-sdkroot”/Applications/Xcode.app/Contents/Developer--cache”/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/SomeLibraryComponent/obj/iPhone/Debug/mtouch-cache--nomanifest--nosign-dev”/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/bin/iPhone/Debug/Developer/MonoTouch/usr/lib/mono/2.1/System.dll“-r”/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll“-r”/Developer/MonoTouch/usr/lib/mono/2.1/MonoTouch.dll“-r”/Users/somedeveloper/projects/SomeLibraryComponent/Components/SomeLibrary-1.0/lib/ios/SomeLibrary.ios.dll“-调试-sdk”6.1“-targetver”6.0“-abi=armv7“-v”“-v”“-v”“-编译器:clang++”“/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/bin/iPhone/Debug/SomeLibraryComponent.exe”
Xamarin.iOS 7.0.1.4(4cfca2f)使用框架的商业版:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
将assembly/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/bin/iPhone/Debug/SomeLibraryComponent.exe链接到/Users/somedeveloper/projects/SomeLibraryComponent/obj/iPhone/Debug/mtouch cache/PreBuild
错误MT2002:未能解析程序集:“SomeLibrary,版本=0.0.0.0,区域性=中性,PublicKeyToken=null”
未能解析程序集:“SomeLibrary,版本=0.0.0.0,区域性=中性,PublicKeyToken=null”
在MonoTouch.Tuner.Linker.Process(MonoTouch.Tuner.LinkerOptions选项、Mono.Linker.LinkContext和context、System.Collections.Generic.List`1和assemblems)[0x00000]中:0
在:0中的MTouch.LinkAssemblies(System.String main、System.Collections.Generic.List`1和assemblies、System.String output\u dir、Mono.Linker.LinkContext和link\u context)[0x00000]处
在:0中的MonoTouch.Application.ManagedLink()[0x00000]处
位于:0中的MonoTouch.Application.ProcessAssemblies()[0x00000]
位于:0中的MonoTouch.Application.BuildApp()[0x00000]
在0中的MonoTouch.Application.Build()[0x00000]处
在:0中的MTouch.Main2(System.String[]args)[0x00000]处
在:0中的MTouch.Main(System.String[]args)[0x00000]处

它与公钥(令牌)无关

从日志的第一部分来看,您的.dll似乎被命名为“SomeLibrary.iOS.dll”。然而,错误消息是查找“SomeLibrary”,而不是“SomeLibrary”
Building: SomeLibraryComponent (Debug|iPhone)

Detecting signing identity...
Provisioning Profile: XXXXXXXXXXXXXXXXXXXXXXXXXXXX
Signing Identity: "iPhone Developer: XXXXXXXXXX (ALKJLKJSLDKJFLJ)"
App ID: "SDLFJLKSDJF.SomeLibrarycomponent"
Performing main compilation...
/Library/Frameworks/Mono.framework/Versions/3.2.3/bin/mcs /noconfig "/r:/Developer/MonoTouch/usr/lib/mono/2.1/mscorlib.dll" -nostdlib     "/out:/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/bin/iPhone/Debug/SomeLibraryComponent.exe" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" "/r:/Users/somedeveloper/projects/SomeLibraryComponent/Components/SomeLibrary-1.0/lib/ios/SomeLibrary.iOS.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" /nologo /warn:4 /debug:full /optimize- /codepage:utf8 "/define:DEBUG;__MOBILE__;__IOS__"  /t:exe "/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/Main.cs" "/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/AppDelegate.cs" "/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/SomeLibraryComponentViewController.cs" "/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/SomeLibraryComponentViewController.designer.cs"
Compilation succeeded - 1 warning(s)

/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/SomeLibraryComponentViewController.cs(48,24): warning CS0672: Member `SomeLibraryComponent.SomeLibraryComponentViewController.ShouldAutorotateToInterfaceOrientation(MonoTouch.UIKit.UIInterfaceOrientation)' overrides obsolete member `MonoTouch.UIKit.UIViewController.ShouldAutorotateToInterfaceOrientation(MonoTouch.UIKit.UIInterfaceOrientation)'. Add the Obsolete attribute to `SomeLibraryComponent.SomeLibraryComponentViewController.ShouldAutorotateToInterfaceOrientation(MonoTouch.UIKit.UIInterfaceOrientation)'
/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll (Location of the symbol related to previous warning)


Build complete -- 0 errors, 1 warning

Compiling to native code
/Developer/MonoTouch/usr/bin/mtouch -sdkroot "/Applications/Xcode.app/Contents/Developer" --cache "/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/obj/iPhone/Debug/mtouch-cache" --nomanifest --nosign -dev "/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/bin/iPhone/Debug/SomeLibraryComponent.app" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" -r "/Users/somedeveloper/projects/SomeLibraryComponent/Components/SomeLibrary-1.0/lib/ios/SomeLibrary.iOS.dll" -debug -sdk "6.1" -targetver "6.0" --abi=armv7 "-v" "-v" "-v" "--compiler:clang++" "/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/bin/iPhone/Debug/SomeLibraryComponent.exe"
Xamarin.iOS 7.0.1.4 (4cfca2f) Business Edition using framework:     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
Linking assembly     /Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/bin/iPhone/Debug/SomeLibraryComponent.exe into     /Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/obj/iPhone/Debug/mtouch-cache/PreBuild
error MT2002: Failed to resolve assembly: 'SomeLibrary, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
Failed to resolve assembly: 'SomeLibrary, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
  at MonoTouch.Tuner.Linker.Process (MonoTouch.Tuner.LinkerOptions options, Mono.Linker.LinkContext& context, System.Collections.Generic.List`1& assemblies) [0x00000] in <filename unknown>:0
  at MTouch.LinkAssemblies (System.String main, System.Collections.Generic.List`1& assemblies, System.String output_dir, Mono.Linker.LinkContext& link_context) [0x00000] in <filename unknown>:0
  at MonoTouch.Application.ManagedLink () [0x00000] in <filename unknown>:0
  at MonoTouch.Application.ProcessAssemblies () [0x00000] in <filename unknown>:0
  at MonoTouch.Application.BuildApp () [0x00000] in <filename unknown>:0
  at MonoTouch.Application.Build () [0x00000] in <filename unknown>:0
  at MTouch.Main2 (System.String[] args) [0x00000] in <filename unknown>:0
  at MTouch.Main (System.String[] args) [0x00000] in <filename unknown>:0