2010-02-20 3 views
1

새 프로젝트를 만들고 빌드하고 실행하면 디버깅을 위해 web.config를 수정하라는 메시지가 표시되고 예를 클릭했습니다. 투영 된 벌금 벌금. 나는 대상 CPU를 64 비트로 전환했는데 예외가 생겼다. 어떻게하면 64 비트 프로젝트를 만들고 실행할 수 있습니까?어떻게하면 64 비트 asp.net 프로젝트를 만들 수 있습니까?

Server Error in '/' Application. 
Could not load file or assembly 'x64Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.BadImageFormatException: Could not load file or assembly 'x64Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format. 

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 

[BadImageFormatException: Could not load file or assembly 'x64Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.] 
    System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0 
    System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43 
    System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127 
    System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142 
    System.Reflection.Assembly.Load(String assemblyString) +28 
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46 

[ConfigurationErrorsException: Could not load file or assembly 'x64Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.] 
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613 
    System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203 
    System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105 
    System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178 
    System.Web.Compilation.WebDirectoryBatchCompiler..ctor(VirtualDirectory vdir) +163 
    System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors) +53 
    System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors) +175 
    System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +86 
    System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +261 
    System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +101 
    System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +126 
    System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +62 
    System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +33 
    System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40 
    System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +160 
    System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93 
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155 


Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927 

답변

4

32 비트 및 64 비트 시스템 모두에서 작동하는 대상 CPU를 "모두"로 둘 수 있습니다.

(오류 메시지에서 판단, 실제로 당신이 그것을 실행하려고 64 비트 시스템 아니에요. 보이는 것)

당신이 "64"로 대상을 지정하면

는 여전히 동일 컴파일되어 . 유일한 차이점은 어셈블리에 64 비트 시스템에서만 사용되도록 제한하는 플래그가 있다는 것입니다.

기본적으로 어셈블리를 64 비트로 제한하는 유일한 이유는 64 비트 시스템 용으로 컴파일 된 단독 실행 라이브러리를 사용하는 경우입니다.

+0

또는 64 비트 프레임 워크가 설치되어 있지 않습니까? –

+0

이상한. 그러나 이것으로 뭐죠? Win7이 설치되어 있습니다. 별도의 프레임 워크가 필요합니까? IIRC 저는 Visual Studio 2008을 사용하고 있습니다. –

+0

@ acidzombie24 : 32 비트 모드로 IIS를 실행할 가능성도 있습니다. (프레임 워크 1.1에서 웹 응용 프로그램을 실행하는 경우이 작업이 필요합니다.) – Guffa

관련 문제