5

I was using the Math.NET Neodym library for a project on Visual C# for a winforms application.

Here's the project's link: Math.NET Neodym Now, I want to port it over to Windows Phone 8, When adding a reference to the library in the WP8 SDK, I get an error along the lines of:

a reference to a higher version or incompatible assembly cannot be added

Now, I've asked this question before, and Ive been told that I can port the library to WP8 by recompiling it. And I have no idea how to? Do I just copy paste each file from the Library into a new WP8 library project and compile?

Victor Zakharov
  • 25,801
  • 18
  • 85
  • 151
7VoltCrayon
  • 662
  • 1
  • 7
  • 22

2 Answers2

6

The easiest way would be to convert the project to a Portable Class Library. This would allow it to be used by Windows Phone as well as desktop apps.

You should be able to just open the solution, and change the appropriate project properties to do this. However, if any types are not supported by the target framework(s), you'll need to rework or remove those portions of the library.

Reed Copsey
  • 554,122
  • 78
  • 1,158
  • 1,373
  • Thankyou very much for the answer, but turns out VS2012 Express doesnt HAVE the Portable Class Library Template: http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj714086(v=vs.105).aspx I'm a student, and I only have Express. :'( – 7VoltCrayon Jan 11 '13 at 21:23
  • 1
    @Suleman Then you just need to change the project type directly to a windows phone lib. – Reed Copsey Jan 11 '13 at 21:59
  • Awesome! Worked Perfectly. and took hardly half a minute :) Thankyou Reed! – 7VoltCrayon Jan 12 '13 at 17:50
  • @Breedly Right now, PCL isn't a supported target from C++/CLI - it would need to be `/clr:pure` to even work (in theory), but the compiler tools aren't there. For pure managed code, I'd just use C# anyways, though. – Reed Copsey May 01 '13 at 15:44
  • @ReedCopsey what do you mean by Windows phone lib ? – onmyway133 Jun 20 '13 at 03:18
  • @entropy A Windows Phone Library Project. – Reed Copsey Jun 20 '13 at 15:45
1

Please see the answer to this question at a previous post. This might not be an issue with "higher version", just VS2012 having an irrelevant error message.

Community
  • 1
  • 1
JustinAngel
  • 16,082
  • 3
  • 44
  • 73
  • I can't find an Unblock in the Properties, by file Explorer, you mean the Windows Explorer right? – 7VoltCrayon Jan 12 '13 at 18:19
  • Are you sure it's the same file you can't add a reference to? If "unblock" isn't in Windows Explorer file properties then the file is already unblocked and you should be fine there. It might really be a platform compatibility issue in that case. – JustinAngel Jan 12 '13 at 18:23
  • Yup, same file. Strangely enough I didnt even edit a single line in the source code,as @Reed Copsey mentionned above, just made a New Windows Phone Library Class project, and added all the existing files of the Math.NET library. Compiled, and then added the dll without any problem. – 7VoltCrayon Jan 12 '13 at 18:27