Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8350561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:21:17+00:00 2026-06-09T08:21:17+00:00

We got a homework in college, to make a Local web-site using MVC and

  • 0

We got a homework in college, to make a Local web-site using MVC and VB, that will read from a Json file (that is places in the App_Data folder) some seed data and populate the database.
The problem is, I’m not sure how to make Json read from the file in App_data, without assigning a full address to it.
What happens, pretty much, is I give it an address:

File.ReadFile("~/App_Data/emails.json") 'Also tried "App_Data/emails.json"

After that, I pass this path (as filename) to a StreamReader:

Using fileRead As New IO.StreamReader(filename)
  Json read stuff

And instead of reading this address as the address of the Project (“C:\Users\BlueLight\Desktop\Codes\VBA\NMCAss2\App_Data\emails.json”) it throws an Exception, that it
“could not find a part of the path ‘C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0\App_Data\emails.json’.” So, it searches in a different place.
Can I redirect this path to my App_Data, without using the full path? Or, maybe there is a problem somewhere in my logic?

Thanks in advance.

Update: I tried reversing “/” with “\” like “App_Data\filename.json” and “‘~\App_Data\filename.json” it still didn’t work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T08:21:17+00:00Added an answer on June 9, 2026 at 8:21 am

    Apparently, the best way to fix it is using

    System.Web.HttpContext.Current.Server.MapPath("~/App_Data/namemails.json")
    

    Works perfectly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a c homework problem that is doing my head in and will
I've got homework, to take phone numbers from a text file, and put it
Homework. Dice Game. I've got an array that represents five rolls of a die.
got a simple web site, in html. I do a simple function to move
I know that I am missing something simple here. I have got this homework
Got a homework assignment that is giving me problems.... Its modifying a JSF project
Ok so I've got this question for homework, I'm given that 'Host X' sends
I have some homework that I was flying through until I got to this
I got a homework assignment asking me to invoke a function without explicitly calling
I just got a homework assignment, and it's just creating a linear search algorithm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.