ASP.NET Core Web Application with Shared project


I’ve got problem with adding shared project to solution with ASP.NET CoreWeb Application.
Build and run works ok, but when I try to install any NuGet package I get error:

Value cannot be null.
Parameter name: source (1.0 MB)

When I remove shared project from solution managing NuGet’s works ok.

What could be wrong?


This is a Visual C# Project, not an Elements one?

Web Application - Visual C# project with Elements Shared project

Yeah, how is that supposed to work? a .csproj Visual C# project is compiled by Microsoft’s compiler, which will never, ever, not once, reach out to any of our compiler chain to do anything with it.

Don’t even need to compile anything - just add nuget reference. Don’t know what is going on, but it’s hard to remove all shared to make NuGets working. When I add only Elements project it’s ok. Sth is wrong with shared, but I can’t find what

Well, the point is, of you have a VC# project, none of or code is involved. At all. If something fails, you’ll have to check with Microsoft.

But a VC# project having a shared project reference to an .elements one is not supported. all that does is add the elements source files to the VC# project — whether the VC# compiler can handle them or (most likely) not.

In production I have class library with shared referenced to and class library referenced to web application. Everything works with .NET Core except NuGet problem. NuGet manager probably looking for sth in all projects and it fails with Emements shared

I’m not sure what else to tell you.

A VC# project referencing an Elements shared project is not supported, and I’m not shocked it causes problems, as VC# and the VC# IDE support won’t know what to do with it.

I’m not using Elements shared project i VC# project.
I use Elements shared project in Elements .NET 461 class library, and that library in VC# project.

When I open VC# project in new solution NuGets are working even with referenced library.
When in my whole solution (with all needed projects) I have any Elements shared project it generates problem

Value cannot be null.
Parameter name: source

Adding Elements shared to solution - even without references makes problem

Ah ok. So what’s the exact steps you take to get the error? And ia assume true invoking them on the VC# project?

Create new VC# ASP.NET Core Web application, add Elements share project to solution and try to add any NuGet package to VC# ASP.NET Core Web application - maybe the same with any other VC# project - don’t know

Problem with .NET Core projects. When I create .NET WPF app it works

Logged as bugs://E25255.

Ok, logged, but chances are still very high that this problem is all inside MS’s stack and out of our control, since you are working with the VC# project, and that’s not ours. But we’ll see.

bugs://E25255 was closed as fixed.

Thanks - works perfect :slight_smile:

1 Like

happy to hear!