Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
1.11/5 (2 votes)
See more:
I have a 64 bit dll reference in an asp.net website project. It doesnot build because I am referencing class from that dll. I have tried adding using namespace but still it does not run, it shows error at complietime.Please help me out.
Posted
Updated 14-Jan-16 1:25am
v2
Comments
hypermellow 14-Jan-16 7:31am    
What's the compile time error message?
What CPU are you targeting in your project build configuration? (x86/x64/Any CPU)
... are you building this on a x64 or x86 machine?
Member 11098660 14-Jan-16 8:06am    
"type or namespace (x64dll name) doesnot exist..." . website project have only anyCpu in configuration manager. & I'm running vs2013 on win864bit.
hypermellow 14-Jan-16 8:51am    
How did you add the reference?
In VS, when you right click the dll and select properties - what value does the Copy Local show?
Royston Malcomber 14-Jan-16 9:20am    
In the configuration manager, select 'new' in the Active Solution platform drop down, select x64 and click OK.
Victor Tseng 12-Sep-18 23:19pm    
Website project type doesn't support platform other than Any CPU. I also tried to manually modify the .sln file to add the x64 target but VS will just force change it back to Any CPU.

1 solution

It's a bad idea to target your assemblies to any instruction-set architecture except "AnyCPU". But sometimes, you have to do that. This is only needed if one of the dependencies is a native (non-managed) module. On the local system supporting matching it can be considered acceptable.

But not for ASP.NET, unless you have a dedicated host and solve highly specialized problems. In nearly all cases, you should not assume any concrete instruction-set architecture. In case of mismatch, your solution won't work.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900