Solved

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

Posted on 2013-10-23
4
781 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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.
The viewer will learn how to count occurrences of each item in an array.

911 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

25 Experts available now in Live!

Get 1:1 Help Now