开发者

HttpHandlers x64 problem

开发者 https://www.devze.com 2023-02-19 03:52 出处:网络
I developed a .Net 3.5 x64 web application that includes a custom HttpHandler in the config: <add path=\"*.class1\" verb=\"GET\" type=\"ClassLibrary1.Class1Handler\"/>

I developed a .Net 3.5 x64 web application that includes a custom HttpHandler in the config:

<add path="*.class1" verb="GET" type="ClassLibrary1.Class1Handler"/>

This works when the platform target for ClassLibrary1 is set at x86.

However, when I set this to x64 I get the following error when I run web application starts (it compiles just fine):

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your co开发者_如何学Gonfiguration file appropriately.

Parser Error Message: Could not load file or assembly 'ClassLibrary1, 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.

Does this mean that a HttpHandler can be compiled at x86 only?

That doesn't make much sense to me.

Does anyone have an idea of what could be going on?

Edit 1:

The ClassLibrary1 project is just an empty class library project with a single HttpHandler added (which is also empty).

Edit 2:

I am also getting these warning messages when compiling, I am pretty sure they have something to do with this problem:

Assembly generation -- Referenced assembly 'mscorlib.dll' targets a different processor HttpTest

Edit 3:

I manually edited the project file to force references to the x64 assemblies, like this:

<Reference Include="$(Windir)\Microsoft.NET\Framework64\v2.0.50727\System.dll"/>

This does supress the above warning message, but the problem isn't resolved.

Thanks!


You probably compiled your assembly ClassLibrary1 with the attribute x86. Try to compile it with AnyCPU tag.


One of your dependent assemblies is compiled with the flag set to x86 rather than AnyCPU or x64

See this page for how to use the coreflags.exe to query the assebly in question

0

精彩评论

暂无评论...
验证码 换一张
取 消