Re: Adding Files/Links To Projects



"Jeff Gaines" <whitedragon@xxxxxxxxxxxxxxxxx> wrote in message
news:xn0fus1y071ota001@xxxxxxxxxxxxxxxxxxxxxxx
What about a strategy similar to the above that would enable me to switch
between x86 and x64? Each included project can be switched between x86 and
x64 but the 'main' project needs a reference to the class file (dll) that
the included project produces, which are different for x86/x64. Is it
possible to have a means whereby a project can easily be switched back and
forth or is it better to just have an x86 project and an x64 project?

I like compiling and testing for x64 because it is totally unforgiving,
careless use of an 'int' instead of 'uint' and there are pieces of
computer everywhere - so it is a good discipline for me!

If you're using C#, then you should not see any difference whatsoever
between x86 and x64 in managed code. Given that sizeof(int)==sizeof(uint)==4
regardless of the platform, I don't understand what you mean by "careless
use of 'int' instead of 'uint'".

Furthermore, your assemblies shouldn't even be x86- or x64-specific - the
default target platform for a C# project created in VS is "Any", which is
precisely what it says - it will happily run on either OS, and will be
JIT-compiled to native code for the corresponding architecture.

The only case when a .NET assembly is platform specific is when it uses
P/Invoke or COM interop to call into a native DLL/component, and that
component is only available for a specific platform. For example, when you
call user32.dll via P/Invoke, your assembly is still fine, because on 32-bit
OS it will load 32-bit user32.dll, and on 64-bit OS it will load 64-bit
user32.dll. But if you P/Invoke into some custom .dll, which you
redistribute with your application, and which is 32-bit only, then, when
your assembly is loaded and executed on 64-bit OS using 64-bit version of
..NET, it will crash when it'll try to invoke that 32-bit DLL - and that's
when you set the target platform for your assembly to "x86", so that even on
64-bit, it gets JIT-compiled to 32-bit code and run via WoW64.


.



Relevant Pages

  • Re: Integer Dos And Donts
    ... As for why there are X64 and Itanium options? ... An answer is P/Invoke. ... Thus we allow you to bind your app to a single 64-bit platform. ... > proven to be a performance problem via profiling (CLR Profiler is one ...
    (microsoft.public.dotnet.languages.vb)
  • Re: .Net breaks compatibility
    ... > API and COM. ... Via marshalling, P/Invoke, etc. ... The platform is very ...
    (borland.public.delphi.non-technical)
  • Re: About "ActivateDevice"
    ... Again, I'm not sure I agree with the design, but then it's not my platform. ... I have a 'standard' platform that includes all the drivers & registry ... Do you have any good examples of using P/Invoke? ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Deploy error during debugging
    ... and our target platform running windows ce 6.0. ... After that I made a small test application based on the sdk. ... I tipped in the ip address from my target platform. ...
    (microsoft.public.windowsce.platbuilder)
  • Deploy error during debugging
    ... I am trying to make a debug connection between my Visual Studio 2005 ... and our target platform running windows ce 6.0. ... I tipped in the ip address from my target platform. ...
    (microsoft.public.windowsce.platbuilder)