Uchiha Itachi
Uchiha Itachi

Reputation: 1271

FileNotFoundException for NuGet package

I downloaded and installed the NuGet Package: Select.Pdf. At runtime, when I click on the button that utilizes the code using the Select.Pdf namespace, I get the following exception:

enter image description here

The package is in the proper file directory and is properly installed, as you can see via the packages.config file:

<?xml version="1.0" encoding="utf-8"?>
<packages>
    <package id="Select.Pdf" version="16.4.0.1" targetFramework="net452" />
</packages>

I've been fighting with this for 2 weeks and I'm pretty much over it. Has anyone ever encountered this? Does anyone know how to fix this?

Upvotes: 6

Views: 2571

Answers (1)

Venkat
Venkat

Reputation: 2579

Possible fixes for this issue:

  • Please check whether Nuget package restore is enabled and the packages are restored properly.

A folder called packages will be added to the folder where the solution file (.sln) exists when you build the solution or restore NuGet packages.

  • Please check the reference path to the assembly in your project file and the actual location of the assembly is same.

If both project (.csproj) and solution(.sln) files are in the same folder then it will be packages/select.pdf in your project file

  • The version you are using in code and referencing can also cause the mismatch.

Ensure the assembly version restored and referred in the project file are same.

Upvotes: 1

Related Questions