Multiframework project in VS2005

G

Guest

I'm working on a project that compiles and runs on both the .NET
framework and the .NET compact framework. At the moment I maintain
two separate VS2005 project files, a "PC" project file and a
"Windows CE 5.0" project file. The problem is that, whenever I make
changes to one of the projects, I have to manually update the other
project. Is there any way to have just one project file, and then tell
VS to build to a specific target platform?


/anders
 
R

Robert

Anders M. Mikkelsen said:
I'm working on a project that compiles and runs on both the .NET
framework and the .NET compact framework. At the moment I maintain
two separate VS2005 project files, a "PC" project file and a
"Windows CE 5.0" project file. The problem is that, whenever I make
changes to one of the projects, I have to manually update the other
project. Is there any way to have just one project file, and then tell
VS to build to a specific target platform?


I also have this problem. I currently have a project that works great on CF
2.0. I can use this exact code in a win32 project. But as soon as I touch
a form in the designer, many extra properties like Tabstop, etc get added to
the form setup code.

This forces me to have 2 different projects.

Is there any way to develop a CF app under Win32? Debugging is much easier
under Win32 and the processor speed, and deployment are much faster, so
keeping the project under CF only would be great.

If I look at Project Properties/References, I see all CF stuff. If I then
look in the object browser, I see these, as well as
System.Configuration with a path to the full framework.

Thanks in advance.
 
D

Daniel Moth

You are doing the right thing: Maintaining separate projects but sharing the
same code files. There is no other way (since you need to enhance the
desktop project with extra features).

Cheers
Daniel
 
R

Robert

Can you shed some light on this last bit?



Where exactly do these other namespaces creap in from?


Thanks in advance.
 
D

Daniel Moth

Where does it say that object browser is specific to the platform?

With VS2005, play with the values in the "Browse" combobox (e.g. Choose "My
Solution").

Cheers
Daniel
 
R

Robert

Very interesting. That should be the default behavior. Why would you ever
want to see things that are NOT in your solution?!?

Odd that I have looked in the object browser thousands of times, and never
noticed that combo box..

Thanks for the tip.
 
G

Guest

I am maintaining separate projects on the same code files, but in
my case this is NOT the right thing. My code must be able to run
on both .NET and .NET CF and thus the project files are identical
(except for the platform specifics). I'm surprised that this is not
supported by VS out-of-the-box - after all, one of the major
advantages of managed execution is the platform independence.

I'm in the process of writing an add-in that invokes the compiler
"behind the back" of VS. With it I'm able to compile "regular" project
files against the CF libraries.


/anders
 
D

Daniel Moth

I agree, but that is the way it is.

If your code files are identical then maybe taking advantage of
retargetability would suit you best (thus maintaining only the CF project).

Cheers
Daniel
 
G

Guest

If it must run on both platforms, then just create a CF project - there's no
need for a desktop project at all since CF assemblies are retargetable to
the desktop.

-Chris
 
G

Guest

You're right, but I would still like to be able to take advantage of
the full framework when running on a PC. With the C# "preprocessor"
it is possible to have different implementations of the same methods
(as known from the C/C++ world).



/anders
 
G

Guest

According to MS
(http://msdn.microsoft.com/library/d...tuv/html/etcondifferenceswithnetframework.asp):

"Although the file formats of both Frameworks are identical, you cannot take
a binary component compiled in the .NET Compact Framework and run it in the
full .NET Framework. Nor can you take a binary component compiled in the full
..NET Framework and run it in the .NET Compact Framework. The reason is the
strong binding rules."

And
(http://msdn.microsoft.com/library/d...tuv/html/etcondifferenceswithnetframework.asp):

"Applications using regular expressions in the .NET Compact Framework are
not binary compatible with applications using regular expressions in the full
..NET Framework, but they are source code compatible."


/anders
 

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