Compiling for multiple platforms

G

Guest

Using VS.net, can I compile a class library to the .NET framework, and to the
Windows CE .NET compact framework, depending on the configuration?

I have an app, and one of its projects is a class library. I want versions
for desktop and handheld applications. All functions used by the class
library are supported by the .NET compact framework.

So, I have three projects in my solution. I have a Windows Application, a
Class Library, and a Smart Device Application. The Windows Application and
the smart device application both have references to the Class Library.

In the configuration manager, I can't specify anything but .NET for the
platform of the class library. Similarly, the Windows App can choose .NET,
and the Smart Device App can choose Windows CE.

Is there any way to use the same source code for both projects, and specify
which version to create? Ideally, I would like to have two configurations,
one for WinCE and one for "regular" windows, and the platform for the class
library would depend on which was chosen.
 
P

Peter Huang

Hi David,

Based on my knowledge, so far we can not change the platform of a .net
application.
As a workaround, we have to create a new project of that platform and then
add the source code to the new created project.
Anyway, this is an good idea, I think you may try to post your idea to the
mswish.

Microsoft offers several ways for you to send comments or suggestions about
Microsoft products. If you have suggestions for product enhancements that
you would like to see in future versions of Microsoft products, please
contact us using one of the methods listed later in this article.

Let us know how we can improve our products.

Product Enhancement suggestions can include:

" Improvements on existing products.
" Suggestions for additional features.
" Ways to make products easier to use.

World Wide Web - To send a comment or suggestion via the Web, use one of
the following methods:

" In Internet Explorer 6, click Send Feedback on the Help menu and then
click the link in the Product Suggestion section of the page that appears.
" In Windows XP, click Help and Support on the Start menu. Click Send your
feedback to Microsoft, and then fill out the Product Suggestion page that
appears.
" Visit the following Microsoft Web site: http://www.microsoft.com/ms.htm
" Click Microsoft.com Guide in the upper-right corner of the page and then
click Contact Us . Click the link in the Product Suggestion section of the
page that appears.
" Visit the following Microsoft Product Feedback Web site:
"http://register.microsoft.com/mswish/suggestion.asp" and then complete and
submit the form.

E-mail - To send comments or suggestions via e-mail, use the following
Microsoft Wish Program e-mail address, (e-mail address removed).
FAX - To send comments or suggestions via FAX, use the following Microsoft
FAX number, (425) 936-7329.

Each product suggestion is read by a member of our product feedback team,
classified for easy access, and routed to the product or service team to
drive Microsoft product and/or service improvements. Because we receive an
abundance of suggestions (over 69,000 suggestions a year!) we can't
guarantee that each request makes it into a final product or service. But
we can tell you that each suggestion has been received and is being
reviewed by the team that is most capable of addressing it.

All product or service suggestions received become the sole property of
Microsoft. Should a suggestion be implemented, Microsoft is under no
obligation to provide compensation.


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi David,

You don;t need to compile multiple times, a .NET executable should runs
everywhere the framework is installed. being it a windows, linux (mono), a
pocketPC, etc.

That of course is theory :)
What happen is that different platform provides differents level of
implementation, I will give you an example using the desktop version and the
PPC version, in the pocketPC the framework lacks of a LOT of functionality
found in the full framework. this means that you cannot take a desktop app
and run it on a pocketPC , you will get lots of errors regarding not found
methods, etc.
Now as the PocketPC framework is a subset of the full framework an
application developed for the PPC will run WITHOUT CHANGES in the desktop,
this of course if you do not use any P/Invoke !!!

In the same way there are features like serialization that are not
implemented in the compact framework.

Other than that you should be OK :)

Cheers,
 
G

Guest

Thanks guys. i ended up exporting to a new project, and discovered that part
of the problem was that i had marked a class 'Serializable".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top