Avatar of Camillia
CamilliaFlag for United States of America asked on

"Relative" path doesnt work on the webserver

Not sure why this doesnt work and i'm new to the project. This works on my laptop.
The project on my laptop is setup like this:
c:\
  Projects
      Express
          Balance
               Web
                   Sites
                        MySite
                             aspx and folders here
*** We moved the code to our websever and created a WEBSITE. The directory for it is like this:
   c:
      Projects
            MySite
              aspx and other folders here  

---*** This is what happens:
1. on my laptop, I see this when i click on a menu item:
http:/.../Mysite/en-Us/Kids/shoes    **** note MySite is there

2. On the webserver, I see  http://www.../en-US/Kids/Shoes and **** the page is not found. That path is not correct. The IIS folder points to C:\Projects\MySite

so howcome this isnt working?
C#ASP.NET

Avatar of undefined
Last Comment
Camillia

8/22/2022 - Mon
Daniel Junges

check the permissions for that directory, be sure that ASPNET user has the permitions.

Have you tried to point the IIS to C:\Projects\MySite\en-US\Kids\Shoes ?
ASKER
Camillia

gave permission to that folder but this isnt about permission. the first page comes up..it's the links that cant be found.

i cant point IIS to that page C:\Projects\MySite\en-US\Kids\Shoes.Website/Virtual Directoy should point at the root not just a random folder...
ydramu

I think, you need to map upto the folder C:\Projects only for your application. Do not include the MySite.

For example,

If Your site url seems like this.
http://www.myexample.com - This should point to C:\Projects

Now
http://www.myexample.com/MySite/ - Points to C:\Projects\MySite



Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
prairiedog

You mentioned the link is not working. How did you create the link?
ASKER
Camillia

We've spent all day on this and still no luck...
Links are read from the Database... And I stepped thru the code.. it's ~\en-US\Shoes\whatever

the en-US is attached to the url. This works fine on our laptop...

ydramu - let me look at what you have and compare.

ASKER
Camillia

I checked IIS and we have it like this:
http://www.myexample.com/MySite/ - Points to C:\Projects\MySite

Maybe it's the code. It builds the URL but when I look at view-->source and the HTML output, they output of the links look the same...
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ydramu

Why dont you try with a simple html page placing in the MySite folder. and try to browse that from URL.

This gives one confirmation that the application Path is correct. then we can figure out what would be the problem with ASPX Pages.

<html>
<title>Testing page</title>
<body>
Testing
</body>
</html>
ydramu

When we move our application to the IIS, we need to set the ASP.NET version for that application.

Could you make sure, that we set that also properly to the version used for development.
ASKER
Camillia

good test, will try and post back
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ASKER
Camillia

This is what we found out: if we run the app from VS2005, it works fine. This is not WAP. It's a website. Now, if I create a virtual directory for the same website, pointing to the same folder that my app is in , the links dont work.

It's like something to do with IIS and maybe code??
ASKER CERTIFIED SOLUTION
ydramu

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ydramu

There are few mistakes in the earlier post. Some sentences not completed properly.

In the IIS select Virtual direcctory, goto properties,  goto ASP.NET tab, verify what is the ASP.NET Version selected for the application and if it is not reflecting the proper .NET Framework version based on your application version. Please change that to reflect the proper version.

In the Properties window itself, goto Virtual Directory Tab, goto the Application Settings -> Beside the Application Name Text box, you will have button named with either Create or Remove. we need to make the Virtual Directory as application. So if that button looks like Create, click on it, it will prepare the virtual directory as Application and the button will change to Remove.

By the way, what happened to the test, we thought to do, regular html page testing.
ASKER
Camillia

test worked. The first page of the app also comes up fine.
All you mentioned is correct.

It's not server specific seems like it...it's a website application, works fine using VS2005 but when we create a VirDir for it, it cant find the paths. The paths are not hardcoded..the ones that are hardcoded are found fine. The ones the code builds are not. But then howcome it works with VS2005 and not we setup IIS for it?? strange stuff.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ydramu

VS2005, has its own ASP.NET Development Web Server, which runs the web pages, If you port those to IIS, we need to map the application properly, by setting the ASP.NET version properly and also preparing the Virtual Directory as Application.

Please verify those once, that would solve our problem.
ASKER
Camillia

It really is set to 2.0 in IIS. We've tried this on 3 servers and it does have Application set as well.

We checked permissions and everything. Anyway to have VS2005 create the IIS folder for us? I know i could do it in WAP and you're right ...website uses its own development web server... would putting it in inetpub make a difference?? maybe my coworker has tried it..
ydramu

How you are porting the Web Application to IIS.

Did you try ever with Publish web site or Copy web site options in VS 2005?

Or might be using XCOPY or folder copying to the IIS Application path.

Please also try with a simple test.aspx page(prepare a simple one) instead of trying with your regular page, which we are getting error.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ASKER
Camillia

we didnt publish. we copied the folder over to the webserver manually and setup iis manually. Let me try that. will post back.
ASKER
Camillia

I setup the app on my local IIS and the link-not-working is not server specific. When we run the app thru VS2005..the links work. When we run the app thru IIS, it doesnt.

I ran 2 test using this link:http://msdn.microsoft.com/en-us/library/aa309370(VS.71).aspx
1. Thru VS2005, code stops , for example, at line 234 and the link works.
2. Thru IIS, i ran the code, attached to worker-process...the first page builds and code stops at break points (this tells me the worker process is working). *** Now i click on the same link BUT..this time...it doesnt even go back to the code...it should at least stop at line 234...NO?

This tells me it doesnt even make a trip to the code when the app is setup thru IIS..

??

ydramu

I feel the problem might be with the DNS lookup of the host name you are trying.

Could you try with http://<ipaddress>/Mysite/en-Us/Kids/shoes/.. like that, instead of domain name there.

And also try with http://localhost/
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER
Camillia

no, we think this is the issue. Whoever developed the app, used HTTPHandler:
http://www.netnewsgroups.net/group/microsoft.public.dotnet.framework.aspnet/topic6884.aspx

now, we tried to add the handler to the webconfig..just like that example and we keep getting an error that assembly could be loaded. The code whatever.ashx is in root of the folder. I compile it and i think it's NBX.dll. I added that and doesnt work.

*** There has to be a way to setup HTTP Handler in IIS because the application is on a server in Texas somewhere and developers there used the same webconfig as us but their app works but ours doesnt. (developers dont work there anymore..so not sure how they set this up)

ASKER
Camillia

fixed. IIS setting that the orig developer had come across. Thanks for sticking with this.