Solved

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

Posted on 2013-10-23
4
866 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
[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
4 Comments
 
LVL 16

Accepted Solution

by:
Kamal Khaleefa earned 400 total points
ID: 39593465
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
ID: 39595308
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
ID: 39595830
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
ID: 39595833
Thank you.
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
The viewer will learn how to count occurrences of each item in an array.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

696 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