4
votes

I am currently working on porting an existing wpf app to a universal windows app.

The existing application is fairly simple and is structured as a normal wpf project, containing the ui layer and filesystem interactions, and a class library containing the main application logic.

I was able to transfer the class library to a Universal Windows Library (windows 10 sdk) without making any substantial changes. This Universal Windows library exists in its own project inside the same solution as the original wpf application. In order to minimize complexity, I would like both the upcoming Universal Windows app and the wpf app to reference the same library. However I am unable to add a reference to the universal Windows library from my wpf project. The library appears in the "add reference" dialog in visual studio, but after selecting the library and clicking OK, I am presented with a message saying that the reference could not be added.

Is what I am trying to do currently not possible, or is there something I'm missing? It seems foolish to need to save the same code into two different library projects for it to be usable.

1
I've verified that the problem is not related to the target framework of either the wpf project or the Library project. (At least not in any way that is visible in the Visual Studio ui.) - weirdev
I've just updated to the latest version of VS as well, and the tooling is no longer there. From what I can gather, this could be because in the RTM they moved from the .csproj file way of describing dependecies, to the project.json file. I can't seem to add .net framework to the project.json dependencies either. We could see this tooling return in VS 2015 Update 1. - Erik Elkins

1 Answers

1
votes

You should be able to select the target frameworks of the class library by right clicking the project > Properties > Library and under targeting hit change, and select .Net framework X on your machine. Then, (aside from incompatible API's in your PCL) you'll be able to reference the project