![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Deployment guideline (using regular DLLs) Is there a deployment guideline or suggestion for how dotnet applications that include regular DLLs ? If a DLL is compiled using a 32 bit compiler then the interop fails in 64 bit environments. The solution seems to be to a) mark the dotnet application as a x86 application forcing it to run in the 32 bit emulator b) recompile the regular DLL with a 64 bit compiler Presumably one needs to have two DLLs which are deployed by an installer according to the target operating system, but one would have expected a safer default handling of the situation. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Deployment guideline (using regular DLLs) a non e mouse <anon@xxxxxx> wrote: Quote: > Is there a deployment guideline or suggestion for how dotnet > applications that include regular DLLs ? > If a DLL is compiled using a 32 bit compiler then the interop fails in > 64 bit environments. The solution seems to be to > a) mark the dotnet application as a x86 application forcing it to run > in the 32 bit emulator emulate 32-bit software, they run it natively (with almost no performance loss). Quote: > b) recompile the regular DLL with a 64 bit compiler > Presumably one needs to have two DLLs which are deployed by an > installer according to the target operating system, but one would have > expected a safer default handling of the situation. with the application, test whether you're running as 32-bit or 64-bit at runtime and copy the appropriate DLL under the expected file name before doing interop. This seems more trouble than it's worth, though. What's unsafe about checking it at install time? People shouldn't expect to be able to move installed applications to completely different architectures. Note that if your .NET application does not require the extra memory that comes with being a 64-bit application (and running under a 64-bit OS already gives you 4 GB as opposed to 2 or 3 on a 32-bit OS), it's perfectly alright to mark it as x86 and use the 32-bit implementation throughout. Your application does not somehow become better when running as 64-bit. -- J. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Deployment guideline (using regular DLLs) Thanks for the guidance. The point was that I presume that native DLL PIF headers indicate that they are 32 bit and one would expect the .NET platform to recognize it instead of crashing on the interop call. On Jan 28, 12:50*am, Jeroen Mostert <jmost...@xxxxxx> wrote: .... Quote: > This seems more trouble than it's worth, though. What's unsafe about > checking it at install time? People shouldn't expect to be able to move > installed applications to completely different architectures. Quote: > -- > J. |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Deployment guideline (using regular DLLs) a non e mouse <anon@xxxxxx> wrote: Quote: > The point was that I presume that native DLL PIF headers indicate that > they are 32 bit and one would expect the .NET platform to recognize it > instead of crashing on the interop call. > that the image is invalid (which is what I would expect)? The latter behavior is par for the course when a 32-bit application tries to load a 64-bit DLL (or vice versa) and the runtime can't detect you're going to be doing interop with an unloadable DLL (interop is fully dynamic, and there's no equivalent of "static linking"). The .NET framework doesn't analyze the library itself, it relies on the OS loading mechanisms. You'd basically see the same thing happening if an unmanaged application tried to LoadLibrary() an incompatible DLL at runtime. If the DLL were linked instead, the EXE would refuse to load. -- J. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Missing .DLLs | Vista General | |||
| Help with Deployment Workbench and Deployment Services | Vista installation & setup | |||
| Asp.net and library dlls | .NET General | |||
| Micrsoft Deployment and Vista image deployment.... | Vista installation & setup | |||
| DLLs in some Gadgets | Vista General | |||