Solved

The remote server returned an error: (404) Not Found.

Posted on 2013-10-23
4
733 Views
Last Modified: 2013-10-23
Hi experts
I got the error:
  "The remote server returned an error:404 Not Found" when I do "GetResponse" with the following code.

  var request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(base.Url());
  var response = (System.Net.HttpWebResponse)request.GetResponse();

Open in new window


I'd checked the content of "base.Url()" and it was fine. I could use it to access the remote file via the Internet Explorer.

Actually the code used to work but now it gave me the above error. Kindly please point to me the right direction. Thanks in Advance.
0
Comment
Question by:dominicwong
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
Kamal Khaleefa earned 400 total points
Comment Utility
try to trace your code and check what is the value of base.url
0
 
LVL 10

Assisted Solution

by:ienaxxx
ienaxxx earned 100 total points
Comment Utility
one example here:
string baseUrl = Request.Url.Scheme + "://" + Request.Url.Authority +
    Request.ApplicationPath.TrimEnd('/') + "/";

perhaps in the folder represented by just the base.url() there is no default page.

edit:padas
0
 

Author Comment

by:dominicwong
Comment Utility
Thanks king2002 and ienaxxx for your prompt responses.
I'd checked the base.url as king2002 suggested. I found out that was the source of my grief.
The problem was due to upper and lower case of the file which my program was looking for.
My program was looking for "App.msi" but the file at the remote server was named "APP.msi".

I'd checked the history of my program and the naming convention of the file.
I realized that it had been like that all the way, and it was working fine. I don't know why and since when a url becomes case sensitive.
0
 

Author Closing Comment

by:dominicwong
Comment Utility
Thank you.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now