0

I am having reference issues with a new class library that I just cant figure out. When I add new nuget packages to my reference list they show up with an icon to the left that is not the normal icon.

When I build the project with dotnet build Corporate.<CompanyName>.repository I get about 400 build errors because it cant find the assemblies that im referencing and after I build the nuget references are no longer there. I have another project that uses the same nuget packages and I have no issues with it but those references also don't have the nuget package symbol to the left.

You can see in the image below what I mean. I cant get this to build for the life of me and I cant figure out how to add these as references and not package references in the csproj file. Ive tried manually adding the references but it when I reload the project it has a yellow triangle out next to it.

Any help would be appreciated.

enter image description here

After running dotnet build

enter image description here

And I get 330 errors of this kind error CS0246: The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?) Even though im referencing the required packages to use DbSet.

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
Darth Scitus
  • 490
  • 1
  • 9
  • 21

1 Answers1

0

A few starting points here...

Have you tried to do a clean and rebuild of the project and the entire solution?

If that does not work and clears some items out then I would first take a look at the projects side by side. The project that works and builds without an issue and the project that does not build.

Look at each reference carefully as well as the nuget packages that you have installed versions included.

Look at the targeting frameworks for the projects are they the same?

Hope this helps in some way!

RN92
  • 1,380
  • 1
  • 13
  • 32
  • The above duplicate answer fixed my issue. Thanks for the feedback though. I had been going in circles all day. Hopefully this helps someone else out. – Darth Scitus Feb 25 '19 at 21:58