2013-10-04 2 views
3

xamarin 구성 요소를 빌드하려고합니다. Binding 프로젝트에서 SomeLibrary.dll을 만들었습니다. 이 SomeLibrary.dll과 Component Template (https://components.xamarin.com/guidelines )을 사용하여 SomeLibrary-1.0.xam 구성 요소를 생성했습니다. 이제xamarin 구성 요소가 어셈블리를 해결하지 못했습니다.

mono xamarin-component.exe install /Users/somedeveloper/Desktop/XamarinComponent/component-template-master/SomeLibrary-1.0.xam

(http://forums.xamarin.com/discussion/5640/test-component-packaging 권장) :

나는 자 마린 스튜디오 (내가 가게에 제출하기 전에 구성 요소를 테스트 할 수 있습니다) 위에 SomeLibrary 구성 요소를 설치하려면이 명령을 실행 , SomeLibrary 구성 요소를 테스트하려고합니다. 나는 새로운 프로젝트를 만들고, 프로젝트에 컴포넌트를 추가하고, SomeLibrary API를 사용하는 몇 줄을 썼다. 그리고 빌드하고 실행할 때 다음과 같은 오류가 발생했다. 나는 혼란스럽고 여기에 혼란 스럽다. 어떤 아이디어라도 좋을 것이다. ^^. I 오류에서 볼

중요한 것은 : 그것은 PublicKeyToken의 일종에 대해 불평 할 것으로 보인다

error MT2002: Failed to resolve assembly: 'SomeLibrary, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

. 이게 뭐야? 내 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 

답변

5

그것은 아무 상관이 할에 공개 키 (토큰)로.

로그의 첫 번째 부분부터 .dll의 이름이 "SomeLibrary.iOS.dll"인 것으로 보입니다. 그러나 오류 메시지는 "SomeLibrary.iOS"가 아니라 "SomeLibrary"를 찾고 있습니다.

파일 이름과 내부 어셈블리 이름이 일치하지 않아야합니다.

1

내가 모바일에 Foundation.Mobile을 프로젝트를 복사 에서 프로젝트 파일 이름을 변경하여 여기에 붙어있어. 나는 "구성 요소를 분석하지 못했습니다"라는 메시지를 계속 받았습니다. 대답은 프로젝트 속성에서 실제 어셈블리 이름을 변경하는 것이 었습니다. enter image description here

관련 문제