Jump to content
  • Advertisement
Sign in to follow this  
barakus

[.net] Compile target visual c# express

This topic is 4808 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
The beauty of .NET is that you don't have to worry about that.

When you compile source code into an executable, it isn't compiled into native language. Instead, it is compiled into Microsoft Intermediate Language (MSIL). Check it out by opening up your executable in a hex editor. Note that you can actually read your code!

When the application is run, it is just-in-time (JIT) compiled and stored into cache, more or less. During this step, the MSIL is compiled to native language, and .NET knows all the optimizations for the target processor. Therefore, your application will run optimally on any processor! Java works the same way (sort of).

This obviously offers an advantage over traditonally compiled languages, like unmanaged Cpp, but it also introduces some security issues. I guess that's another topic altogether, though. :D

HTH!

Share this post


Link to post
Share on other sites
The project options will allow you to target a specific platform (64 bit or 32 bit).

Share this post


Link to post
Share on other sites
The only reason you'll need to specify a target platform is when you've made assumptions about the platform in your code (like casting IntPtr to Int32 or something like that). If you leave it on the default of "Any CPU" then it'll be compiled at runtime to 32- or 64-bit, depending on the platform.

Share this post


Link to post
Share on other sites
I cant find the option on express. Im running windows xp64, and when i run the application i get a badimageformatexception, which im pretty sure is because im running a 64 bit application that links to 32 bit dll's. Maybe i could put a command on the pre-build event command line that specifies the target platform? How would i do that?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!