Tooling: "Add Shared Project Reference" missing

Created on 14 Mar 2016  路  7Comments  路  Source: aspnet/Tooling

How do you add a reference to a .shproj (Shared Project) project, the add reference dialog does not list shared projects?

Update:
I found I could use the "compile" in projects.json to include my shared project's folder for compilation.

Issue Tracker Notification Posted TFS Tracked

Most helpful comment

A combination of this issue and the inability to reference DLLs (frequently reported and seemingly ignored, for example) is a blocking issue for us. We have several DLLs that must remain in an older, incompatible .NET Framework (for an older client app) so we can't reference the DLL directly. We tried using shared projects to maintain parallel old-framework and core builds, but core-compatible class libraries can't reference shared projects either (not just ASP.NET Core, apparently). Just in case, we then tried adding the shared projects directly to the ASP.NET Core but of course that is also broken.

All 7 comments

@Cybrosys as you stated dnx/dotnet projects have support to share files between projects. We haven't added first class support for this in Visual Studio yet, but it's on our radar. It's not a high priority item though as we have many other features in front of it.

@sayedihashimi, any approximate ETA for this feature?
also, @Cybrosys, could you elaborate a little on how you made that work, thanks!

@cloudcrypt of course. Open up your project.json files that you want to have the shared files added to, then add the following in each:
"compile": [ "<relative path to folder containing cs files>/*.cs", "<relative path to another folder containing cs files>/*.cs" ]

In my case I have a shared project called Merlot.Dto. The projects that need it have the following in their project.json files:
"compile": [ "../Merlot.Dto/*.cs" ]

@cloudcrypt we have not started working on it, so it will not make the RC2 release. I'm hoping that we can get this in the release after that, but I cannot commit to that at this time.

From what I understand this issue is causing some pain, but it's not blocking anything. if there is anything that you feel that you are blocked on please let me know.

A combination of this issue and the inability to reference DLLs (frequently reported and seemingly ignored, for example) is a blocking issue for us. We have several DLLs that must remain in an older, incompatible .NET Framework (for an older client app) so we can't reference the DLL directly. We tried using shared projects to maintain parallel old-framework and core builds, but core-compatible class libraries can't reference shared projects either (not just ASP.NET Core, apparently). Just in case, we then tried adding the shared projects directly to the ASP.NET Core but of course that is also broken.

The GitHub Issue Tracker for the aspnet/Tooling repo is being deprecated in favor of Visual Studio's Report a Problem tool.

If this issue is still a problem with the RTW release of Visual Studio 2017, please report a new issue using the Report a Problem tool. While you can still use .NET Core and ASP.NET Preview tools with Visual Studio 2015, Visual Studio 2017 is now the officially supported tool for developing .NET Core and ASP.NET Core projects.

By using the Report a Problem tool (available in both VS 2017 and VS 2015), you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks. See Visual Studio's Talk to Us page for more details.

Please use the discussion topic here for feedback and questions on the deprecation of this issue tracker. Thanks!

The issue is fixed for .csproj file.

Was this page helpful?
0 / 5 - 0 ratings