Reputation: 7098
Quick question (I hope), how do I include a window 6 class library dll in a standard net project? I seem to be able to just add a reference via VS in earlier editions of windows mobile projects, but not with version 6. From what I read it should be possible as long as not CE specific libraries have been used.
Any help appreciated.
Thanks, Chris.
Edit:
Not what I have found, I have done the following:
1) Create new windows mobile 6 class library (CF .NET dll)
2) Create new standard class library(Standard .NET dll)
3)Try to include the mobile 6 lib to the standard one
Here I get:
"A reference to cannot be added".
Upvotes: 0
Views: 2287
Reputation: 7098
Ive found the answer to my own question here:
Turns out that VB.NET projects have trouble referencing CF projects created in VB.NET. All good fun.
Upvotes: 1
Reputation: 7285
From my experience you simply cant, which really sucks!!! So much for compile once, run everywhere.
In any case, one solution I found is:
The point is that even though you now have two assemblies, any changes to a cs file are reflected in all of them. This is how XNA GameStudio does things, and how I have grappled with the CF for phones in the past.
Once you have done the initial 'port' things go pretty quickly. The CF project should have a debug symbol (POCKETPC or SMARTPHONE IIRC), but I recommend you add MOBILE so that you can share CF code between PocketPC and SmartPhone projects.
I am thinking of writing a tool to mirror projects, if you are interested say so in the comment and I will make time to do it (right now I am not working on any CF stuff).
It should be possible to automate this with an MSBUILD task as well. But unfortunately by generating a csproj file at build time, one looses intellisense at code time.
Upvotes: 0
Reputation: 104198
If this is a CF .NET dll you can add it as a reference (no matter what version). If it is a native code library, you can't. You need to create a .NET wrapper around this dll (using P/Invoke) and add this dll to your project. You need to take care that the native dll is present at runtime.
Upvotes: 1