Adding references in a shared (.shproj) project Adding references in a shared (.shproj) project windows windows

Adding references in a shared (.shproj) project


You must add the reference in both WP and Windows project.

The reason for this is that shared project is not compiled into any output DLL - it is compiled into the project that references it, so it cannot reference any other project types except other Shared Projects.


I know this is an old question but I had a similar problem with a shared project. I needed a class in the shared project to use ConfigurationManager and the normal way would be to add a reference to the project, but you can't do that with a shared project.

In my case the solution was so simple it should have been obvious (but I was overthinking it!) - just give the full reference when using the configuration manager - EG:

var someVal = System.Configuration.ConfigurationManager.AppSettings["someKey"];

Not very elegant but simple enough.