.NET Framework Bookmark and Share   
 index > 64-Bit .NET Framework Development > Warning due to XBAP, native Code and 64 Bit ...
 

Warning due to XBAP, native Code and 64 Bit ...

I've a problem using native Code in a XBAP-Application and running it on a 64-Bit-System...

Due to the use of native code in C#, I set the Target Platform of these assemblies to x86. Using a WPF-Application (which also is targeted for x86) runs very fine on a 64-Bit-System.

Nevertheless, I also want to use a XBAP-Application to run the same application in the browser. Using x86 here doesn't work:

"Cannot build a platform-specific XAML Browser Application. If HostInBrowser property is set to 'True', either do not set the PlatformTarget property or set it to 'AnyCpu'."

So I tried to use "Any CPU" and then this Warning came up:

"Referenced assembly targets a different processor than the application."

Usually I treat warnings as errors and as a result I can't build this... So here my question:

Is there any way to solve this problem without getting errors / warnings? If yes: plz let me know! If no: can this warning make problems at all?! Can it be ignored? Or is there any other way to run a .Net-Application with dependencies to native code on 64bit?

thx in advance!
  • Edited byDSchiefer Tuesday, August 18, 2009 7:35 AM
  •  
DSchiefer
You cannot control the bit-ness of the browser your user will use. On a 64-bit operating system, she'll no doubt run the 64-bit version of Internet Explorer. Your app will fail to load. Short from instructing your user to only ever use the 32-bit version, you cannot solve this problem in any other way than losing your dependency on the unmanaged code or providing assemblies that were compiled with the 64-bit version of it.

Hans Passant.
nobugz
but you can't provide assemblies compiled with 64-bit using unmanged code, right?
  • Edited byDSchiefer Wednesday, August 19, 2009 6:42 AM
  •  
DSchiefer
You cannot control the bit-ness of the browser your user will use. On a 64-bit operating system, she'll no doubt run the 64-bit version of Internet Explorer. Your app will fail to load. Short from instructing your user to only ever use the 32-bit version, you cannot solve this problem in any other way than losing your dependency on the unmanaged code or providing assemblies that were compiled with the 64-bit version of it.

Hans Passant.

Instructing the user to only ever use the 32-bit version of Internet Explorere won't work. On Windows 7 (RTM), even the 32-bit version of Internet Explorer will launch a 64-bit PresentationHost.exe process.
Wouter Demuynck

You can use google to search for other answers

Custom Search

More Threads

• Smart Device Emulator and 64-bit OS with VS2003 problem
• width of page difference on forms and reports in vista 64
• What is the simplest way to distribute a .NET COM server to any platform?
• Invoking exe through Process Class
• License Compiler problem
• 0xc000007b Error on Vista
• Shell extension C#
• TypeInitializationException
• Increase stack size?
• 64-bit beginner can't get 32- or 64-bit .NET apps to run on 64-bit machine