Question

I have a class library that targets Windows Mobile CF, and I want to use the same dll on some Desktop/Web application. When adding a reference to the project I get the following error.

adding a reference to a device project may produce unexpected results

I am not sure what would be the result of such "unexpected results"

Was it helpful?

Solution

I would use tow project sharing the same code (linked from CF project into FF project to avoid using unsupoorted calls).

So create two lib projects, one for CF and one for FF. Then place your class code in the CF project. In the FF project insert a link to the existing class code file.

As the projects must have different names, you have to edit the Build settings and change the Assembly name to have the same name in CF and FF.

OTHER TIPS

I found that Referencing a dll that was built for a device is acceptable and works fine as long as both (the Mobile and the Desktop/Web apps) targeting the same .NET version. I added a reference of a class library project that is targeting Windows Mobile in a Windows Form applicaiton as well as in an Asp.NET app. Both are working fine.

I found this article here details the situation.

However, the reverse (referencing a desktop class library from a Windows Mobile app) is not allowed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top