Namespace error with nuget package

David Heddle 26 Reputation points
2021-01-12T23:17:30.587+00:00

Hi,

I have used nuget to add a package to visual studio community (Version 16.9.0 preview 2.0), in a C# Blazor web assembly project. The nuGet add seems to work fine, and the package shows up in the dependencies for the project in the solution explorer and in the project file. However, when I try to use an @using in a razor file ur using in a cs file to refer to the package components I get the dreaded "namespace could not be found..." error.

I have tried uninstalling and reinstalling the nuGet package using the command line, the PM console, and the nuget package manager. I have restarted VS many times. Always the same error.

Any suggestions are appreciated. Thanks.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,396 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,396 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,277 questions
{count} votes

Accepted answer
  1. Dylan Zhu-MSFT 6,406 Reputation points
    2021-01-13T07:26:08.947+00:00

    Hi DavidHeddle,

    Please confirm if the framework is same between nuget package and the current project.

    Best Regards,
    Dylan


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our **documentation to enable e-mail notifications if you want to receive the related email notification for this thread.**


0 additional answers

Sort by: Most helpful