6

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?

Uchiha Itachi
  • 1,251
  • 1
  • 16
  • 42
  • I should also point out that I have uninstalled and reinstalled multiple times. I actually switched to this package because I was having the EXACT same problem with `PDFSharp`. – Uchiha Itachi Nov 18 '16 at 16:40
  • Please check whether Nuget package restore is enabled , and the packages are restored properly. The version you are using in code and referencing can also cause mismatch. – Venkat Nov 20 '16 at 06:33
  • @Venkat can you elaborate on that a little more? How do I do/check that? This is literally the first time I'm using NuGet packages, so i'm on Supreme Rookie Mode... – Uchiha Itachi Nov 22 '16 at 01:04
  • A folder called packages will be added in the folder where sln file exists when you build the solution or restore nuget packages – Venkat Nov 22 '16 at 03:42
  • Also,check the reference path to the assembly in your project file and the actual location of the assembly are same. If both proj and sln files are in same folder then it will packages/select.pdf in your project file – Venkat Nov 22 '16 at 03:44
  • 1
    Thanks man. Got it going. If you want to move your comment to an answer, I can accept it. – Uchiha Itachi Nov 22 '16 at 16:06

1 Answers1

1

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.

Venkat
  • 2,549
  • 2
  • 28
  • 61