Git Product home page Git Product logo

Comments (7)

markjprice avatar markjprice commented on June 16, 2024

The package name is not packtlibrary.dll.
It is packt.cs8.sharedlibrary

Look at the solution project's .csproj and copy the package reference from there

from cs8dotnetcore3.

GuildOfCalamity avatar GuildOfCalamity commented on June 16, 2024

Thanks. I didn't realize that you need to go into the \Chapter06\PacktLibrary project first and build that DLL.

However, I still get an error when trying to use the NuGet package manager in VS2019

Severity Code Description Project File Line Suppression State
Error Package restore failed. Rolling back package changes for 'PeopleApp'.

Severity Code Description Project File Line Suppression State
Error NU1105 Unable to find project information for 'C:\Source Code\C# 8.0 and .Net Core 3.0\Chapter06\PacktLibrary\PacktLibrary.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. PeopleApp C:\me\Source Code\C# 8.0 and .Net Core 3.0\Chapter06\PeopleApp\PeopleApp.csproj 1

from cs8dotnetcore3.

GuildOfCalamity avatar GuildOfCalamity commented on June 16, 2024

I had to add the DLL manually as a reference to the project to get it to work. Not sure why the NuGet manager can't install the "Packt.CS8.SharedLibrary" normally.

from cs8dotnetcore3.

markjprice avatar markjprice commented on June 16, 2024

The point of that section is not to reference the class library project. The point is to compile, package, and publish the class library to the public NuGet feed and then reference that package from the console app. If you're fixing the errors by directly referencing the class library then your bypassing the issue. Are you able to reference any other NuGet packages like Newtonsoft.Json? Can you please include your .csproj so I can see your references? It should look like this:

<PackageReference Include="packt.cs8.sharedlibrary" Version="1.0.0" />

from cs8dotnetcore3.

GuildOfCalamity avatar GuildOfCalamity commented on June 16, 2024

OK, I think I must've built them out of order; I was reading chapter 6 and then opened the PeopleApp project.
Thanks for you help. Great book!

from cs8dotnetcore3.

markjprice avatar markjprice commented on June 16, 2024

Ah! When you talked about "a ton of Packt CS8 nuget packages" it sounded like your were working on Chapter 7. I should always remember to request more information before jumping to conclusions. ;-)

If you download solution projects, like PeopleApp and PacktLibrary in Chapter06, then its best to always start by running "dotnet build" in the console app. That would have compiled the PacktLibrary as well as the PeopleApp and you would have avoided seeing errors for the statement: using Packt.Shared;

I will add a note to the sixth edition pointing that out. So thanks for the feedback and I hope you continue to enjoy the book.

from cs8dotnetcore3.

GuildOfCalamity avatar GuildOfCalamity commented on June 16, 2024

No problem. I assumed you saw the path I included about the error "C:\me\Source Code\C# 8.0 and .Net Core 3.0\Chapter06"

Thanks for the "dontnet build" tip!

from cs8dotnetcore3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.