2013-05-04 1 views
0

어셈블리에서 VS 2012 명령 프롬프트가 포함 된 제 3 자 DLL을 포함하여 강력한 키 이름을 지정한 후에 어셈블리 로딩 오류가 발생합니다.파일 또는 어셈블리 'Version = 3.0.1.0, PublicKeyToken = null 또는 해당 종속성 중 하나를로드 할 수 없습니다. 강력한 이름의 어셈블리가 필요합니다.

Could not load file or assembly ', Version=3.0.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044) 



FileLoadException: Could not load file or assembly 'ClubStarterKit.Core, Version=3.0.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)] 

    System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType) +0 `System.Reflection.RuntimeMethodInfo.get_ReturnType() +42 `System.Web.HttpApplicationFactory.ReflectOnMethodInfoIfItLooksLikeEventHandler(MethodInfo m) +19` 
System.Web.HttpApplicationFactory.ReflectOnApplicationType() +374 


System.Web.HttpApplicationFactory.CompileApplication() +143` System.Web.HttpApplicationFactory.EnsureInited() +80 
    System.Web.HttpApplicationFactory.SetupFileChangeNotifications() +67 
    System.Web.Compilation.BuildManager.CompileGlobalAsax() +57 
    System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +269` 

[HttpException (0x80004005): Could not load file or assembly 'ClubStarterKit.Core, Version=3.0.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)] 


System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +62 
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +427 
System.Web.Compilation.BuildManager.CallAppInitializeMethod() +31 
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +530 

[HttpException (0x80004005): Could not load file or assembly 'ClubStarterKit.Core, Version=3.0.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)] 

System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9873912 
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +456 

나는 모든 솔루션에서 모든 빈과 OBJ 폴더를 제거하고 다시 작성 및 배치 빌드 솔루션도 여전히 정확한 오류를 찾을 수 없습니다 어셈블리 버전을 변경하고 청소를 포함했다.

+1

> [어셈블리를로드 할 수 없습니다] 어셈블리를 강력한 키 이름을주고 나서 : 모든 어셈블리가 어디에 서명 조립 있습니까 의존 (3D 파티 어셈블리 포함)도 서명 되었습니까? – k3b

+0

ilasm의 제 3 자 어셈블리를 제외하고 VS 2012에서 다른 어셈블리에 서명하고이를 솔루션에 내 보냈습니다. –

답변

1

위에 열거 한 것은 뒤범벅입니다. 그러나 지난 주에이 오류가 발생하여 운이 좋았습니다. 강력한 이름의 순서를하면 특성이 서명을

그게 전부 추가 키

  • 프로젝트에서 어셈블리 파일에 키를 추가 만들기

    1. 할 필요가 작동합니다! 그것을 수행하는 방법에 대한 정보를 모두 http://www.codeproject.com/Articles/7859/Building-COM-Objects-in-C

      In order for the COM object to be exposed, your class library assembly must also have a strong name. To create a strong name, use the utility SN.EXE.

      Collapse | Copy Code sn -k Database_COM_Key.snk Open the AssemblyInfo.cs and modify the line:

      Collapse | Copy Code [assembly: AssemblyKeyFile("Database_COM_Key.snk")] Build the object. The build also results into a type library that can be imported into your managed or unmanaged code.

      은 또한 당신이 스택에 여기 내 질문을 참조 할 수 있습니다 바로 여기에있다.

  • +0

    AssemblyInfo.cs에서 [assembly : AssemblyKeyFile (@ "C : \\ newkey.snk")] 코드와 함께 강력한 키 이름을 추가하고 대신 다음 명령 줄 옵션 키 파일 또는 적절한 프로젝트 설정을 사용하십시오. of 'assemblykeyfile' –

    +0

    이것은 이것을하는 대신 사용되지 않는 방법이기 때문입니다. 그것은 여전히 ​​잘 작동해야합니다. –

    +0

    내가 지금 얻는 것은 파일 또는 어셈블리 'ClubStarterKit.Core, Version = 3.0.1.0, Culture = neutral, PublicKeyToken = null'또는 그 종속성 중 하나를로드 할 수 없습니다. 찾은 어셈블리의 매니페스트 정의가 어셈블리 참조와 일치하지 않습니다. (HRESULT 예외 : 0x80131040) –

    관련 문제

     관련 문제