?
Solved

What makes an application 64-bit?

Posted on 2009-12-22
11
Medium Priority
?
314 Views
Last Modified: 2013-11-26
Hi there;

I have C sharp forms application that I implemented in VS. 2008 resides program files x86 directory. I am planning to have a setup for it that I will create it from VS. 2008 itself?
1) the platform I implemented the program is Windows 7-64 bit. So is my application an 64-bit application?
2) If not, what makes an application 64-bit? What should I do for a C# application to work in 64-bit?

Best regards.
0
Comment
Question by:jazzIIIlove
  • 2
  • 2
  • 2
  • +4
11 Comments
 
LVL 5

Accepted Solution

by:
danirk2 earned 668 total points
ID: 26107557
Contrary to C./C++ for example, you do not compile C#. The code to run it will be produced on the target machine by the .NET infrastructure (the CLR).  If the CLR runs in a 64-bit environment it will run as such.
Therefore as a developer you don't have to specify a target environment (32 vs 64).
One of the advantages of wrting .net apps.
0
 
LVL 11

Assisted Solution

by:ICaldwell
ICaldwell earned 336 total points
ID: 26107587
In visual studio you can set a Target CPU.. by default its "AnyCPU" which allows it to run on x86 or x64 processors (32 or 64 bit)... you can change this if you want to make it more efficient.... x64 will run floating point calculations much faster then 32 while 32 will run some integer processes faster....

By default for now you don't need to worry about it as long as you haven't change the Target CPU, found in your project properties under compile....
0
 
LVL 11

Assisted Solution

by:lenordiste
lenordiste earned 664 total points
ID: 26107621
Danirk is right. You may have seen an option called "Target CPU" in the advanced compilation tab of your project with options similar to "any, x86, x64,Itanium", but all this option does is give an indication of what CPU architecture your program should support: .NET always generates code in the same way no matter the option in the form of IL. It's the CLR at run time which will interpret the generated IL code to your running plateform.

Here is a nice article about all this:
http://vsh.infozerk.net/articles/visual-studio-net-platform-target-explained/
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Assisted Solution

by:iharding
iharding earned 332 total points
ID: 26107638
0
 

Expert Comment

by:anki1110
ID: 26107649
No, You need to compile your application and specify that it should run on a 64-bit operating system either as a native application or under WOW64. WOW64 is a compatibility environment provided by the operating system that allows a 32-bit application to run on a Windows 64-bit operating system.
0
 
LVL 5

Assisted Solution

by:danirk2
danirk2 earned 668 total points
ID: 26107731
anki1110:Sorry to disagree with you. I suggest you really read the article that lenordiste suggested. (Nice article by the way).

The question was about  C#,  which can never run as a native application.

What you say could be relevant for an unmanaged C++ app, but this is not relevant here.
0
 
LVL 4

Expert Comment

by:BIOGENIUS
ID: 26108726
i totaly agree with danirk2..that was set by microsoft that the advantage of building .NET application is that it configures your application to work as the environment 32 or 64.but:
1) if you build it on 32 you cant run it on 64 else you build it on 64 and vice versa.
2) Don't make your self lose this great advantage (for example by seeting your integers to Int32 or anything like that) but yuo must define you variables like int  because it uses the system default data types lengths.
0
 
LVL 11

Assisted Solution

by:lenordiste
lenordiste earned 664 total points
ID: 26109565
this is not right biogenus, the keyword "int" is always a 32 bit signed integer no matter what you do. You can look it up here: http://msdn.microsoft.com/en-us/library/5kzh1b5w(VS.80).aspx
The keyword "int" is only a shortcut for int32.

.NET executables will run fine in 32 bits and 64 bits environment no matter what you do (use int32 or int64) as long as you are working with type safe managed code (see this great piece: http://msdn.microsoft.com/en-us/library/ms973190.aspx).

So you can actually use int64 and run it on a 32 bit system without any problem. The only problem is that it won't be an atomic operation anymore since the CLR will have to make additionnal calculations which it won't have to do on a 64 bit plateform.

Finally, just to make sure no one gets confused, 64 bits is not faster than 32 bits if you don't plan ahead and make your algorithms take benefit of the 64 bit plateforms.



0
 
LVL 4

Expert Comment

by:BIOGENIUS
ID: 26112227
Ok thank you lenordiste.
you are right but i'm not totaly wrong...what i'm said is valid in unmanage languaues and i have a conflicted information due to data models that affect data types .... see this link:
http://en.wikipedia.org/wiki/64-bit
0
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 26120930
oh dear...I will read and reply each and every comment soon...
0
 
LVL 12

Author Closing Comment

by:jazzIIIlove
ID: 31669126
sorry guys, I was late...I have a problem with a C# code that needs to run under SSH. If you want, you can join there too since, I really get the idea of arch. since some dlls of mine are compiled under 64-bit etc.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question