Richard Moore
Richard Moore

Reputation: 1162

VS2017 Can't add reference to shared project / shared projects empty

I just came across this scenario and thought I'd share it in case it saves you some time.

I have a fairly large solution in VS2017 and have a shared project that contains some common code such as enums.

I just tried to add my shared project to another project (right click project, add reference and go to shared Projects section) and noticed that the shared projects was empty. It wasn't giving me the shared project as an option.

See my answer below...

Upvotes: 2

Views: 2006

Answers (1)

Richard Moore
Richard Moore

Reputation: 1162

After a bit of digging it dawned on me that my shared project is C# whereas the project I was trying to add it to was VB.Net.

Obvious when you realise it, but I was still thinking of a shared project compiling to an assembly (dll) which could be referenced from VB.Net or C#. Whereas a shared project should be thought of more like a C++ include. Shared projects simply insert the source code into the recipient project and can only be used with projects of the same language.

Upvotes: 5

Related Questions