Dynamically setting path for include files

D

Dave

I have two environments: DEV and PROD. In DEV I have two independent webs.
In PROD one of the webs is the root and the other is a subweb of the root.

Each enviornment has a different file system configuration so I must
manually change the file location references in my code when I post from DEV
to PROD.

For example, I want to reference an include file that is located in the
subweb from the root web. The physical file structure looks like this....

--DEV
c:\inetpub\wwwroot\myroot
c:\inetpub\wwwroot\mysubweb\includes\mypage.inc

--PROD
e:\InetPub\Clients\myroot\mysubweb\includes\mypage.inc

....which means if I call the include file from myroot I have to use
different references ....

--DEV
<!--#include file="../mysubweb/includes/mypage.inc"-->

--PROD
<!--#include file="mysubweb/includes/mypage.inc.inc"-->


I am using ASP 3.0 and I have several include files for db connections,
menus, etc that are shared between the two webs.

What is the best practice for handling this situtation as efficiently as
possible?

Thanks
Dave
 
Y

Yuan Ren[MSFT]

Hi Dave,

Welcome to MSDN newsgroup!

Based on my understanding, you want to replace the path in "include" tag
for deploying the current project to the production environment. If I have
misunderstood anything, please let me know.

As far as I know, the good way for current issue is using replacement
function supplied by IDE. For example, you could change the "../mysubweb/"
to "mysubweb" in the whole project by using "Replace All" function. And
then, you can deploy all changed files to the target machine.

I hope my suggestion will be helpful. If you have any concern, please feel
free to let me know. I'm looking forward your reply.

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top