• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1160
  • Last Modified:

vb.net 'Newtonsoft' is not declared. It may be inaccessible due to its protection level.

Hello All;

In Visual Studio, I have NewtonSoft added to the "NuGet"
The "Bin" folder has all required resources.
I have these in the top.

Imports Newtonsoft.Json.Linq
Imports Newtonsoft.Json

Open in new window

Running the project from VS, it works great.
Running the project from its web folder gives the error.

Compiler Error Message: BC30451: 'Newtonsoft' is not declared. It may be inaccessible due to its protection level.

On this line.
Dim playList = Newtonsoft.Json.JsonConvert.DeserializeObject(Of VidList)(jsonString)

Open in new window

What else do I need to do, in order to run the NewtonSoft components outside of VS?

Wayne Barron
Wayne Barron
  • 2
  • 2
1 Solution
Fernando SotoRetiredCommented:
I am not a web developer but it sounds like the NewtonSoft.dll has not been installed on the web server when you installed the web application. Make sure that NewtonSoft.dll is installed.
Dan McFaddenSystems EngineerCommented:
In what scope did you declare the variable (Public, Private Protected)?  The protection level error message may indicate that the variable is not available (declare) outside the scope of some class or partial class.

Posting additional code will help trouble shoot the issue.

Wayne BarronAuthor Commented:
Thanks for the information. I had to do the same thing to another project as well.
Here is the link to that EE Thread.
Wayne BarronAuthor Commented:
I had gone through this once before and with a lack of sleep.
I had forgotten all about it.
Fernando, you helped me to remember something I had done just nearly a month ago.

Fernando SotoRetiredCommented:
Not a problem Wayne, glad I was able to help and thanks for the info. Have a great day.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now