Solved

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

Posted on 2017-04-19
5
331 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 63

Accepted Solution

by:
Fernando Soto earned 500 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 28

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 63

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 learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

pc, laptop  monitor connection configurations
On Beyond Tools A conversation I recently had with the DevOps manager of a major online retailer really made me think about DevOps monitoring tools (https://www.onpage.com/devops-incident-management-tool/). The manager and I discussed how sever…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

624 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