我正在尝试构建一个xamarin组件. 我从Binding项目创建了一个SomeLibrary.dll. 使用此SomeLibrary.dll和组件模板( https://components.xamarin.com/guidelines ),我已经生成了一个SomeLibrary-1.0.xam组件. 我执行此命
我从Binding项目创建了一个SomeLibrary.dll.
使用此SomeLibrary.dll和组件模板( https://components.xamarin.com/guidelines
),我已经生成了一个SomeLibrary-1.0.xam组件.
我执行此命令将SomeLibrary组件安装到Xamarin Studio上(因此我可以在将组件提交到商店之前对其进行测试):
mono xamarin-component.exe安装/Users/somedeveloper/Desktop/XamarinComponent/component-template-master/SomeLibrary-1.0.xam
(http://forums.xamarin.com/discussion/5640/test-component-packaging推荐)
现在,我正在尝试测试我的SomeLibrary组件.我创建了一个全新的项目,将组件添加到我的项目中,写了几行使用SomeLibrary api,并在构建和运行时遇到以下错误.
我在这里迷茫和困惑,任何想法,建议都会很棒.^^.
我从错误中看到的主要是:
错误MT2002:无法解析程序集:’SomeLibrary,Version = 0.0.0.0,Culture = neutral,PublicKeyToken = null’
它似乎在抱怨某种PublicKeyToken.这是什么?我是否必须为SomeLibrary组件生成PublicKeyToken?如果是这样,我如何生成PublicKeyToken.
感谢并感谢任何帮助,建议或评论!^ _ ^!,
完整错误日志
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它与公钥(令牌)无关.
从日志的第一部分开始,您的.dll似乎被命名为“SomeLibrary.iOS.dll”.但是,错误消息是查找“SomeLibrary”,而不是“SomeLibrary.iOS”.
文件名和内部程序集名称之间必定不匹配.