Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2017-04-19
5
Medium Priority
?
774 Views
Last Modified: 2017-04-19
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?

Thanks.
Carrzkiss
0
Comment
Question by:Wayne Barron
  • 2
  • 2
5 Comments
 
LVL 64

Accepted Solution

by:
Fernando Soto earned 2000 total points
ID: 42098785
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.
0
 
LVL 29

Expert Comment

by:Dan McFadden
ID: 42098868
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.

Dan
0
 
LVL 31

Author Comment

by:Wayne Barron
ID: 42099167
@Fernando
Thanks for the information. I had to do the same thing to another project as well.
Here is the link to that EE Thread.
0
 
LVL 31

Author Closing Comment

by:Wayne Barron
ID: 42099168
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.

Wayne
0
 
LVL 64

Expert Comment

by:Fernando Soto
ID: 42099184
Not a problem Wayne, glad I was able to help and thanks for the info. Have a great day.
1

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the modern office, employees tend to move around the workplace a lot more freely. Conferences, collaborative groups, flexible seating and working from home require a new level of mobility. Technology has not only changed the behavior and the expe…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question