The same web.config and global.asax files

  • Thread starter Thread starter Ruslan
  • Start date Start date
R

Ruslan

Hello,



I have to project: one ASN.NET project and another - Web Service in the same
solution. I want to use the same web.config and global.asax files. Does it
possible?



Thanks,



Ruslan
 
Ruslan,

It is certainly possible, but I would recommend to use different folders
for your service and web application. That way, if you need to make a change
in the future that is not common to both (say, you want to use Forms
authentication for your ASP.Net project while having anonymous web service)
you can still do it.
 
Thank you,




I did that. I have 2 folders, for web service and web application. I put the
web.config file in the up folder for service and web applications. For
instance:



Web service ---- C:\project\web\serviceFolder

Web application ---- C:\project\web\applicationFolder

Web.config---- C:\project\web\web.config



If I put this structure in the root, I mean, C:\Inetpub\wwwroot, it works.
But if I put it in another place and I create virtual directory, it doesn't
work



Regards,

Ruslan
 
Technically it shouldn't matter whether you put it under web root or not.
Framework just goes up one level to fine web.config file. The only thing to
watch out for is - your folder where web.config & global.asa are located has
to be "an application" in IIS terms. When you create your vroot make sure
you point to that folder. In the Internet Services Manager right-click that
virtual folder and make sure button "Create" is disabled (click it if it is
not).

When you say "it doesn't work" what symptoms are you referring to?
 
What happens if you copy web.config into your serviceFolder and
applicationFolder. Does it start working? And also, what is the
configuration of your vroot? Does it point to C:\project\web (in other words
do you type http://<server>/<vrootname>/web/applicationFolder to get to your
application pages) and configured to be an application?
 
Back
Top