1

I have a solution AddLog which has only one project AddLogClient of type shared project. I created it by right clicking on solution name->Add->Shared Project.

enter image description here

I want to use this shared project in other solutions. When I go to another solution MyApplication and want to add a reference to AddLogClient, I can't see it in the list of shared projects, because it is not located in the same solution. When I try to browse for it, it expects a file in .exe, .dll, .tlb, .olb, .olx or .winmd format. Adding .dll file (from bin folder from AddLogClient) would not be acceptable because every developer has different repository checkout location and we can't use relative paths.

enter image description here

How can I reference shared project from other solutions? Both solutions are under SVN.

5
  • can't you use the .csproj file of AddLogClient to add it to your solution ? Commented Feb 23, 2020 at 16:22
  • A SharedProject is not actually what you think it means. It is a project used to share code between multiple assemblies, Take a look at this SO answer which clears that up: stackoverflow.com/a/30638495/4482565 Commented Feb 23, 2020 at 16:24
  • If I reference .csproj file, then developers of solution MyApplication can still see and modify the code of AddLogClient. What if I don't want that? I just want to provide them some functions to use without exposing source code. Commented Feb 23, 2020 at 16:26
  • 2
    The standard way of doing this then is using a NuGet package. Consider using a private hosted Nuget server on your premises to isolate your codebase from the outside world. Commented Feb 23, 2020 at 16:35
  • Thank you for NuGet suggestion. Is there no way to use the same shared project from multiple solutions? Commented Feb 23, 2020 at 16:44

1 Answer 1

2

The standard way of doing so, as @Sokopa suggested is through NuGet. For dev purposes, if you do not want to publish packages to Nuget servers, you can check the Generate Nuget Package on Build option and upon build it will create a nuget package in your build folder.

check this guide from microsoft docs

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.