Web Part Assembly not found error

Imran Ali Bajwa 1 Reputation point
2020-07-29T19:44:58.717+00:00

Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies
I am trying to use npgsql in visual web part but i got this error even i have added assembly.But for testing purpose when i created a .net website it works fine i don't know what the problem for using this assembly in sharepoint web part.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,603 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Jerryzy 10,571 Reputation points
    2020-07-30T07:26:29.997+00:00

    Need to add the assembly in Package.package:

    14551-image-thumb-645.png

    14489-image-thumb-646.png

    Here is a blog specify the similiar question for your reference:

    Could Not Load File Or Assembly Or One Of Its Dependencies – Issue In SharePoint Farm Solution


  2. Imran Ali Bajwa 1 Reputation point
    2020-08-11T13:02:24.767+00:00

    Thank you my problem is Solved by installing 3. ... version of NPGSQl


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.