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"

有帮助吗?

解决方案

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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top