Is there a way to get the Site ID for an IIS web site with VB.NET code?
What I would like to do is get the site id number then call
aspnet_regiis with the -s option to set the ASP.NET version of the site
to 2.0.50727 based on this site ID with.

Any help or sample code would be GREATLY appreciatted!!

Thanks!

Re: VB.NET code needed to get IIS Site ID by Superfreak3

Superfreak3
Thu Jan 18 08:09:06 CST 2007


Superfreak3 wrote:
> Is there a way to get the Site ID for an IIS web site with VB.NET code?
> What I would like to do is get the site id number then call
> aspnet_regiis with the -s option to set the ASP.NET version of the site
> to 2.0.50727 based on this site ID with.
>
> Any help or sample code would be GREATLY appreciatted!!
>
> Thanks!


Also, I saw some mention(s) that in IIS 6.0, the site ID is derived
from the Web Site Name by some process while in IIS 5.0, its a
sequential number.

I have a test system that looks like IIS 6 is in place. I check the
Web Site ID (also from an article I read) by going to the site
properties in IIS then logging properties. At the bottom of that
dialog the log name appears, which is supposed to contain the site ID.

On my test system, this number appeared as 2, which I did not think
would be the correct ID on IIS 6 as I thought this would be derived
from the Name somehow. Anyway, I was able to register the site as v2.0
using this site ID in the aspnet_regiis utility.

I guess my mechanism that I hope to be able to code in some fashion
should handle finding the site ID in both IIS 5.0 & 6.0.

In deploying our web site installation, I simply want to automate the
process if .NET 1.1 and 2.0 are on the same machine.

HELP IS GREATLY APPRECIATED!!!


Re: VB.NET code needed to get IIS Site ID by Kristofer

Kristofer
Thu Jan 18 10:27:13 CST 2007

Hi,

I have an example of this in C#, it should not be that hard to translate
it into VB.NET.

"C# - Enumerate websites"
http://www.gafvert.info/iis/article/cs_enum_iis_websites.htm

--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info


Superfreak3 wrote:

>Is there a way to get the Site ID for an IIS web site with VB.NET code?
> What I would like to do is get the site id number then call
>aspnet_regiis with the -s option to set the ASP.NET version of the site
>to 2.0.50727 based on this site ID with.
>
>Any help or sample code would be GREATLY appreciatted!!
>
>Thanks!

Re: VB.NET code needed to get IIS Site ID by Superfreak3

Superfreak3
Thu Jan 18 12:19:02 CST 2007


Kristofer Gafvert wrote:
> Hi,
>
> I have an example of this in C#, it should not be that hard to translate
> it into VB.NET.
>
> "C# - Enumerate websites"
> http://www.gafvert.info/iis/article/cs_enum_iis_websites.htm
>
> --
> Regards,
> Kristofer Gafvert
> http://www.gafvert.info/iis/ - IIS Related Info
>
>
> Superfreak3 wrote:
>
> >Is there a way to get the Site ID for an IIS web site with VB.NET code?
> > What I would like to do is get the site id number then call
> >aspnet_regiis with the -s option to set the ASP.NET version of the site
> >to 2.0.50727 based on this site ID with.
> >
> >Any help or sample code would be GREATLY appreciatted!!
> >
> >Thanks!

Since this looks pretty simple, although I should say I'm no code guru,
will this return the numerical id that is needed for use in my
aspnet_regiis command.


Re: VB.NET code needed to get IIS Site ID by Kristofer

Kristofer
Thu Jan 18 12:32:15 CST 2007

It will return the ID for the website(s).

--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info


Superfreak3 wrote:

>
>Kristofer Gafvert wrote:
>>Hi,
>>
>>I have an example of this in C#, it should not be that hard to translate
>>it into VB.NET.
>>
>>"C# - Enumerate websites"
>>http://www.gafvert.info/iis/article/cs_enum_iis_websites.htm
>>
>>--
>>Regards,
>>Kristofer Gafvert
>>http://www.gafvert.info/iis/ - IIS Related Info
>>
>>
>>Superfreak3 wrote:
>>
>>>Is there a way to get the Site ID for an IIS web site with VB.NET code?
>>> What I would like to do is get the site id number then call
>>>aspnet_regiis with the -s option to set the ASP.NET version of the site
>>>to 2.0.50727 based on this site ID with.
>>>
>>>Any help or sample code would be GREATLY appreciatted!!
>>>
>>>Thanks!
>
>Since this looks pretty simple, although I should say I'm no code guru,
>will this return the numerical id that is needed for use in my
>aspnet_regiis command.

Re: VB.NET code needed to get IIS Site ID by Superfreak3

Superfreak3
Thu Jan 18 16:16:25 CST 2007


Kristofer Gafvert wrote:
> It will return the ID for the website(s).
>
> --
> Regards,
> Kristofer Gafvert
> http://www.gafvert.info/iis/ - IIS Related Info
>
>
> Superfreak3 wrote:
>
> >
> >Kristofer Gafvert wrote:
> >>Hi,
> >>
> >>I have an example of this in C#, it should not be that hard to translate
> >>it into VB.NET.
> >>
> >>"C# - Enumerate websites"
> >>http://www.gafvert.info/iis/article/cs_enum_iis_websites.htm
> >>
> >>--
> >>Regards,
> >>Kristofer Gafvert
> >>http://www.gafvert.info/iis/ - IIS Related Info
> >>
> >>
> >>Superfreak3 wrote:
> >>
> >>>Is there a way to get the Site ID for an IIS web site with VB.NET code?
> >>> What I would like to do is get the site id number then call
> >>>aspnet_regiis with the -s option to set the ASP.NET version of the site
> >>>to 2.0.50727 based on this site ID with.
> >>>
> >>>Any help or sample code would be GREATLY appreciatted!!
> >>>
> >>>Thanks!
> >
> >Since this looks pretty simple, although I should say I'm no code guru,
> >will this return the numerical id that is needed for use in my
> >aspnet_regiis command.

If I know the name of the web site, how can I simply grab its Site ID.
Also, if installed on a non-server OS, the site appears as a virtual
directory under the Default Web Site. Is the ID found in the same way
or will it carry the 1 of the default site?

Thanks for the info so far!!!


Re: VB.NET code needed to get IIS Site ID by Kristofer

Kristofer
Fri Jan 19 00:34:06 CST 2007

See my other example here:

"C# - Find website ID by name"
http://www.gafvert.info/iis/article/cs_find_id_by_name.htm

You cannot have a website beneath "Default Website". That is a virtual
directory (or just a directory), both on a client OS and a server OS. So
it does not have a website ID, only websites have this.

So if you need to configure something on the virtual directory (and not
globally on the website), you will need to figure out a way to get the
virtual directory.

--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info


Superfreak3 wrote:

>
>Kristofer Gafvert wrote:
>>It will return the ID for the website(s).
>>
>>--
>>Regards,
>>Kristofer Gafvert
>>http://www.gafvert.info/iis/ - IIS Related Info
>>
>>
>>Superfreak3 wrote:
>>
>>>
>>>Kristofer Gafvert wrote:
>>>>Hi,
>>>>
>>>>I have an example of this in C#, it should not be that hard to translate
>>>>it into VB.NET.
>>>>
>>>>"C# - Enumerate websites"
>>>>http://www.gafvert.info/iis/article/cs_enum_iis_websites.htm
>>>>
>>>>--
>>>>Regards,
>>>>Kristofer Gafvert
>>>>http://www.gafvert.info/iis/ - IIS Related Info
>>>>
>>>>
>>>>Superfreak3 wrote:
>>>>
>>>>>Is there a way to get the Site ID for an IIS web site with VB.NET code?
>>>>> What I would like to do is get the site id number then call
>>>>>aspnet_regiis with the -s option to set the ASP.NET version of the site
>>>>>to 2.0.50727 based on this site ID with.
>>>>>
>>>>>Any help or sample code would be GREATLY appreciatted!!
>>>>>
>>>>>Thanks!
>>>
>>>Since this looks pretty simple, although I should say I'm no code guru,
>>>will this return the numerical id that is needed for use in my
>>>aspnet_regiis command.
>
>If I know the name of the web site, how can I simply grab its Site ID.
>Also, if installed on a non-server OS, the site appears as a virtual
>directory under the Default Web Site. Is the ID found in the same way
>or will it carry the 1 of the default site?
>
>Thanks for the info so far!!!

Re: VB.NET code needed to get IIS Site ID by Superfreak3

Superfreak3
Fri Jan 19 08:07:18 CST 2007


Kristofer Gafvert wrote:
> See my other example here:
>
> "C# - Find website ID by name"
> http://www.gafvert.info/iis/article/cs_find_id_by_name.htm
>
> You cannot have a website beneath "Default Website". That is a virtual
> directory (or just a directory), both on a client OS and a server OS. So
> it does not have a website ID, only websites have this.
>
> So if you need to configure something on the virtual directory (and not
> globally on the website), you will need to figure out a way to get the
> virtual directory.
>
> --
> Regards,
> Kristofer Gafvert
> http://www.gafvert.info/iis/ - IIS Related Info
>
>
> Superfreak3 wrote:
>
> >
> >Kristofer Gafvert wrote:
> >>It will return the ID for the website(s).
> >>
> >>--
> >>Regards,
> >>Kristofer Gafvert
> >>http://www.gafvert.info/iis/ - IIS Related Info
> >>
> >>
> >>Superfreak3 wrote:
> >>
> >>>
> >>>Kristofer Gafvert wrote:
> >>>>Hi,
> >>>>
> >>>>I have an example of this in C#, it should not be that hard to translate
> >>>>it into VB.NET.
> >>>>
> >>>>"C# - Enumerate websites"
> >>>>http://www.gafvert.info/iis/article/cs_enum_iis_websites.htm
> >>>>
> >>>>--
> >>>>Regards,
> >>>>Kristofer Gafvert
> >>>>http://www.gafvert.info/iis/ - IIS Related Info
> >>>>
> >>>>
> >>>>Superfreak3 wrote:
> >>>>
> >>>>>Is there a way to get the Site ID for an IIS web site with VB.NET code?
> >>>>> What I would like to do is get the site id number then call
> >>>>>aspnet_regiis with the -s option to set the ASP.NET version of the site
> >>>>>to 2.0.50727 based on this site ID with.
> >>>>>
> >>>>>Any help or sample code would be GREATLY appreciatted!!
> >>>>>
> >>>>>Thanks!
> >>>
> >>>Since this looks pretty simple, although I should say I'm no code guru,
> >>>will this return the numerical id that is needed for use in my
> >>>aspnet_regiis command.
> >
> >If I know the name of the web site, how can I simply grab its Site ID.
> >Also, if installed on a non-server OS, the site appears as a virtual
> >directory under the Default Web Site. Is the ID found in the same way
> >or will it carry the 1 of the default site?
> >
> >Thanks for the info so far!!!

Would you know the answer to this question as I don't know if the
'problem' is tied to my attempted use of aspnet_regiis or not.

On a server system, it appears in IIS that our site is in addition to
the Default Web Site as it doesn't appear as a sub/virtual directory to
it in the tree. However, when we launch http://localhost, our site is
launched. The developer would have expected the call to require
http://localhost/OurSite/login.aspx.

Do you think I might have done something by using w3svc/1/root/OurSite
in the aspnet_regiis command?

I'm trying to determine if its a setting in my install program (Wise
for Windows Installer) that is incorrect or if I messed up the
hierarchy by using a bad aspnet_regiis command line.

GREATLY APPRECIATED!!!!!!


Re: VB.NET code needed to get IIS Site ID by Kristofer

Kristofer
Fri Jan 19 10:26:22 CST 2007

Hello,

http://localhost/ does not necessarily has to be tied to the "Default
Website". That is determined by the ServerBindings property. If you
created a new website, and the new website is listening on "localhost", it
will be this website responding.

This has nothing to do with the aspnet_regiis command.

--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info


Superfreak3 wrote:

>
>Kristofer Gafvert wrote:
>>See my other example here:
>>
>>"C# - Find website ID by name"
>>http://www.gafvert.info/iis/article/cs_find_id_by_name.htm
>>
>>You cannot have a website beneath "Default Website". That is a virtual
>>directory (or just a directory), both on a client OS and a server OS. So
>>it does not have a website ID, only websites have this.
>>
>>So if you need to configure something on the virtual directory (and not
>>globally on the website), you will need to figure out a way to get the
>>virtual directory.
>>
>>--
>>Regards,
>>Kristofer Gafvert
>>http://www.gafvert.info/iis/ - IIS Related Info
>>
>>
>>Superfreak3 wrote:
>>
>>>
>>>Kristofer Gafvert wrote:
>>>>It will return the ID for the website(s).
>>>>
>>>>--
>>>>Regards,
>>>>Kristofer Gafvert
>>>>http://www.gafvert.info/iis/ - IIS Related Info
>>>>
>>>>
>>>>Superfreak3 wrote:
>>>>
>>>>>
>>>>>Kristofer Gafvert wrote:
>>>>>>Hi,
>>>>>>
>>>>>>I have an example of this in C#, it should not be that hard to
>>>>>>translate
>>>>>>it into VB.NET.
>>>>>>
>>>>>>"C# - Enumerate websites"
>>>>>>http://www.gafvert.info/iis/article/cs_enum_iis_websites.htm
>>>>>>
>>>>>>--
>>>>>>Regards,
>>>>>>Kristofer Gafvert
>>>>>>http://www.gafvert.info/iis/ - IIS Related Info
>>>>>>
>>>>>>
>>>>>>Superfreak3 wrote:
>>>>>>
>>>>>>>Is there a way to get the Site ID for an IIS web site with VB.NET
>>>>>>>code?
>>>>>>> What I would like to do is get the site id number then call
>>>>>>>aspnet_regiis with the -s option to set the ASP.NET version of the
>>>>>>>site
>>>>>>>to 2.0.50727 based on this site ID with.
>>>>>>>
>>>>>>>Any help or sample code would be GREATLY appreciatted!!
>>>>>>>
>>>>>>>Thanks!
>>>>>
>>>>>Since this looks pretty simple, although I should say I'm no code guru,
>>>>>will this return the numerical id that is needed for use in my
>>>>>aspnet_regiis command.
>>>
>>>If I know the name of the web site, how can I simply grab its Site ID.
>>>Also, if installed on a non-server OS, the site appears as a virtual
>>>directory under the Default Web Site. Is the ID found in the same way
>>>or will it carry the 1 of the default site?
>>>
>>>Thanks for the info so far!!!
>
>Would you know the answer to this question as I don't know if the
>'problem' is tied to my attempted use of aspnet_regiis or not.
>
>On a server system, it appears in IIS that our site is in addition to
>the Default Web Site as it doesn't appear as a sub/virtual directory to
>it in the tree. However, when we launch http://localhost, our site is
>launched. The developer would have expected the call to require
>http://localhost/OurSite/login.aspx.
>
>Do you think I might have done something by using w3svc/1/root/OurSite
>in the aspnet_regiis command?
>
>I'm trying to determine if its a setting in my install program (Wise
>for Windows Installer) that is incorrect or if I messed up the
>hierarchy by using a bad aspnet_regiis command line.
>
>GREATLY APPRECIATED!!!!!!

Re: VB.NET code needed to get IIS Site ID by Superfreak3

Superfreak3
Fri Jan 19 10:40:05 CST 2007


Kristofer Gafvert wrote:
> Hello,
>
> http://localhost/ does not necessarily has to be tied to the "Default
> Website". That is determined by the ServerBindings property. If you
> created a new website, and the new website is listening on "localhost", it
> will be this website responding.
>
> This has nothing to do with the aspnet_regiis command.
>
> --
> Regards,
> Kristofer Gafvert
> http://www.gafvert.info/iis/ - IIS Related Info
>
>
> Superfreak3 wrote:
>
> >
> >Kristofer Gafvert wrote:
> >>See my other example here:
> >>
> >>"C# - Find website ID by name"
> >>http://www.gafvert.info/iis/article/cs_find_id_by_name.htm
> >>
> >>You cannot have a website beneath "Default Website". That is a virtual
> >>directory (or just a directory), both on a client OS and a server OS. So
> >>it does not have a website ID, only websites have this.
> >>
> >>So if you need to configure something on the virtual directory (and not
> >>globally on the website), you will need to figure out a way to get the
> >>virtual directory.
> >>
> >>--
> >>Regards,
> >>Kristofer Gafvert
> >>http://www.gafvert.info/iis/ - IIS Related Info
> >>
> >>
> >>Superfreak3 wrote:
> >>
> >>>
> >>>Kristofer Gafvert wrote:
> >>>>It will return the ID for the website(s).
> >>>>
> >>>>--
> >>>>Regards,
> >>>>Kristofer Gafvert
> >>>>http://www.gafvert.info/iis/ - IIS Related Info
> >>>>
> >>>>
> >>>>Superfreak3 wrote:
> >>>>
> >>>>>
> >>>>>Kristofer Gafvert wrote:
> >>>>>>Hi,
> >>>>>>
> >>>>>>I have an example of this in C#, it should not be that hard to
> >>>>>>translate
> >>>>>>it into VB.NET.
> >>>>>>
> >>>>>>"C# - Enumerate websites"
> >>>>>>http://www.gafvert.info/iis/article/cs_enum_iis_websites.htm
> >>>>>>
> >>>>>>--
> >>>>>>Regards,
> >>>>>>Kristofer Gafvert
> >>>>>>http://www.gafvert.info/iis/ - IIS Related Info
> >>>>>>
> >>>>>>
> >>>>>>Superfreak3 wrote:
> >>>>>>
> >>>>>>>Is there a way to get the Site ID for an IIS web site with VB.NET
> >>>>>>>code?
> >>>>>>> What I would like to do is get the site id number then call
> >>>>>>>aspnet_regiis with the -s option to set the ASP.NET version of the
> >>>>>>>site
> >>>>>>>to 2.0.50727 based on this site ID with.
> >>>>>>>
> >>>>>>>Any help or sample code would be GREATLY appreciatted!!
> >>>>>>>
> >>>>>>>Thanks!
> >>>>>
> >>>>>Since this looks pretty simple, although I should say I'm no code guru,
> >>>>>will this return the numerical id that is needed for use in my
> >>>>>aspnet_regiis command.
> >>>
> >>>If I know the name of the web site, how can I simply grab its Site ID.
> >>>Also, if installed on a non-server OS, the site appears as a virtual
> >>>directory under the Default Web Site. Is the ID found in the same way
> >>>or will it carry the 1 of the default site?
> >>>
> >>>Thanks for the info so far!!!
> >
> >Would you know the answer to this question as I don't know if the
> >'problem' is tied to my attempted use of aspnet_regiis or not.
> >
> >On a server system, it appears in IIS that our site is in addition to
> >the Default Web Site as it doesn't appear as a sub/virtual directory to
> >it in the tree. However, when we launch http://localhost, our site is
> >launched. The developer would have expected the call to require
> >http://localhost/OurSite/login.aspx.
> >
> >Do you think I might have done something by using w3svc/1/root/OurSite
> >in the aspnet_regiis command?
> >
> >I'm trying to determine if its a setting in my install program (Wise
> >for Windows Installer) that is incorrect or if I messed up the
> >hierarchy by using a bad aspnet_regiis command line.
> >
> >GREATLY APPRECIATED!!!!!!

That makes me breathe a little easier!!


Re: VB.NET code needed to get IIS Site ID by Superfreak3

Superfreak3
Fri Jan 19 10:43:51 CST 2007


Kristofer Gafvert wrote:
> Hello,
>
> http://localhost/ does not necessarily has to be tied to the "Default
> Website". That is determined by the ServerBindings property. If you
> created a new website, and the new website is listening on "localhost", it
> will be this website responding.
>
> This has nothing to do with the aspnet_regiis command.
>
> --
> Regards,
> Kristofer Gafvert
> http://www.gafvert.info/iis/ - IIS Related Info
>
>
> Superfreak3 wrote:
>
> >
> >Kristofer Gafvert wrote:
> >>See my other example here:
> >>
> >>"C# - Find website ID by name"
> >>http://www.gafvert.info/iis/article/cs_find_id_by_name.htm
> >>
> >>You cannot have a website beneath "Default Website". That is a virtual
> >>directory (or just a directory), both on a client OS and a server OS. So
> >>it does not have a website ID, only websites have this.
> >>
> >>So if you need to configure something on the virtual directory (and not
> >>globally on the website), you will need to figure out a way to get the
> >>virtual directory.
> >>
> >>--
> >>Regards,
> >>Kristofer Gafvert
> >>http://www.gafvert.info/iis/ - IIS Related Info
> >>
> >>
> >>Superfreak3 wrote:
> >>
> >>>
> >>>Kristofer Gafvert wrote:
> >>>>It will return the ID for the website(s).
> >>>>
> >>>>--
> >>>>Regards,
> >>>>Kristofer Gafvert
> >>>>http://www.gafvert.info/iis/ - IIS Related Info
> >>>>
> >>>>
> >>>>Superfreak3 wrote:
> >>>>
> >>>>>
> >>>>>Kristofer Gafvert wrote:
> >>>>>>Hi,
> >>>>>>
> >>>>>>I have an example of this in C#, it should not be that hard to
> >>>>>>translate
> >>>>>>it into VB.NET.
> >>>>>>
> >>>>>>"C# - Enumerate websites"
> >>>>>>http://www.gafvert.info/iis/article/cs_enum_iis_websites.htm
> >>>>>>
> >>>>>>--
> >>>>>>Regards,
> >>>>>>Kristofer Gafvert
> >>>>>>http://www.gafvert.info/iis/ - IIS Related Info
> >>>>>>
> >>>>>>
> >>>>>>Superfreak3 wrote:
> >>>>>>
> >>>>>>>Is there a way to get the Site ID for an IIS web site with VB.NET
> >>>>>>>code?
> >>>>>>> What I would like to do is get the site id number then call
> >>>>>>>aspnet_regiis with the -s option to set the ASP.NET version of the
> >>>>>>>site
> >>>>>>>to 2.0.50727 based on this site ID with.
> >>>>>>>
> >>>>>>>Any help or sample code would be GREATLY appreciatted!!
> >>>>>>>
> >>>>>>>Thanks!
> >>>>>
> >>>>>Since this looks pretty simple, although I should say I'm no code guru,
> >>>>>will this return the numerical id that is needed for use in my
> >>>>>aspnet_regiis command.
> >>>
> >>>If I know the name of the web site, how can I simply grab its Site ID.
> >>>Also, if installed on a non-server OS, the site appears as a virtual
> >>>directory under the Default Web Site. Is the ID found in the same way
> >>>or will it carry the 1 of the default site?
> >>>
> >>>Thanks for the info so far!!!
> >
> >Would you know the answer to this question as I don't know if the
> >'problem' is tied to my attempted use of aspnet_regiis or not.
> >
> >On a server system, it appears in IIS that our site is in addition to
> >the Default Web Site as it doesn't appear as a sub/virtual directory to
> >it in the tree. However, when we launch http://localhost, our site is
> >launched. The developer would have expected the call to require
> >http://localhost/OurSite/login.aspx.
> >
> >Do you think I might have done something by using w3svc/1/root/OurSite
> >in the aspnet_regiis command?
> >
> >I'm trying to determine if its a setting in my install program (Wise
> >for Windows Installer) that is incorrect or if I messed up the
> >hierarchy by using a bad aspnet_regiis command line.
> >
> >GREATLY APPRECIATED!!!!!!


Ooops, more questions.

So is it that the latest/new site will respond to http://localhost?
Why would http://localhost/MySite\login.aspx not work in this instance.

I guess maybe an understanding of the ServerBindings property would
help.

I wonder if ServerBindings could be set to act on
http://localhost/MySite/login.aspx??


Re: VB.NET code needed to get IIS Site ID by Superfreak3

Superfreak3
Fri Jan 19 11:14:25 CST 2007


Superfreak3 wrote:
> Kristofer Gafvert wrote:
> > Hello,
> >
> > http://localhost/ does not necessarily has to be tied to the "Default
> > Website". That is determined by the ServerBindings property. If you
> > created a new website, and the new website is listening on "localhost", it
> > will be this website responding.
> >
> > This has nothing to do with the aspnet_regiis command.
> >
> > --
> > Regards,
> > Kristofer Gafvert
> > http://www.gafvert.info/iis/ - IIS Related Info
> >
> >
> > Superfreak3 wrote:
> >
> > >
> > >Kristofer Gafvert wrote:
> > >>See my other example here:
> > >>
> > >>"C# - Find website ID by name"
> > >>http://www.gafvert.info/iis/article/cs_find_id_by_name.htm
> > >>
> > >>You cannot have a website beneath "Default Website". That is a virtual
> > >>directory (or just a directory), both on a client OS and a server OS. So
> > >>it does not have a website ID, only websites have this.
> > >>
> > >>So if you need to configure something on the virtual directory (and not
> > >>globally on the website), you will need to figure out a way to get the
> > >>virtual directory.
> > >>
> > >>--
> > >>Regards,
> > >>Kristofer Gafvert
> > >>http://www.gafvert.info/iis/ - IIS Related Info
> > >>
> > >>
> > >>Superfreak3 wrote:
> > >>
> > >>>
> > >>>Kristofer Gafvert wrote:
> > >>>>It will return the ID for the website(s).
> > >>>>
> > >>>>--
> > >>>>Regards,
> > >>>>Kristofer Gafvert
> > >>>>http://www.gafvert.info/iis/ - IIS Related Info
> > >>>>
> > >>>>
> > >>>>Superfreak3 wrote:
> > >>>>
> > >>>>>
> > >>>>>Kristofer Gafvert wrote:
> > >>>>>>Hi,
> > >>>>>>
> > >>>>>>I have an example of this in C#, it should not be that hard to
> > >>>>>>translate
> > >>>>>>it into VB.NET.
> > >>>>>>
> > >>>>>>"C# - Enumerate websites"
> > >>>>>>http://www.gafvert.info/iis/article/cs_enum_iis_websites.htm
> > >>>>>>
> > >>>>>>--
> > >>>>>>Regards,
> > >>>>>>Kristofer Gafvert
> > >>>>>>http://www.gafvert.info/iis/ - IIS Related Info
> > >>>>>>
> > >>>>>>
> > >>>>>>Superfreak3 wrote:
> > >>>>>>
> > >>>>>>>Is there a way to get the Site ID for an IIS web site with VB.NET
> > >>>>>>>code?
> > >>>>>>> What I would like to do is get the site id number then call
> > >>>>>>>aspnet_regiis with the -s option to set the ASP.NET version of the
> > >>>>>>>site
> > >>>>>>>to 2.0.50727 based on this site ID with.
> > >>>>>>>
> > >>>>>>>Any help or sample code would be GREATLY appreciatted!!
> > >>>>>>>
> > >>>>>>>Thanks!
> > >>>>>
> > >>>>>Since this looks pretty simple, although I should say I'm no code guru,
> > >>>>>will this return the numerical id that is needed for use in my
> > >>>>>aspnet_regiis command.
> > >>>
> > >>>If I know the name of the web site, how can I simply grab its Site ID.
> > >>>Also, if installed on a non-server OS, the site appears as a virtual
> > >>>directory under the Default Web Site. Is the ID found in the same way
> > >>>or will it carry the 1 of the default site?
> > >>>
> > >>>Thanks for the info so far!!!
> > >
> > >Would you know the answer to this question as I don't know if the
> > >'problem' is tied to my attempted use of aspnet_regiis or not.
> > >
> > >On a server system, it appears in IIS that our site is in addition to
> > >the Default Web Site as it doesn't appear as a sub/virtual directory to
> > >it in the tree. However, when we launch http://localhost, our site is
> > >launched. The developer would have expected the call to require
> > >http://localhost/OurSite/login.aspx.
> > >
> > >Do you think I might have done something by using w3svc/1/root/OurSite
> > >in the aspnet_regiis command?
> > >
> > >I'm trying to determine if its a setting in my install program (Wise
> > >for Windows Installer) that is incorrect or if I messed up the
> > >hierarchy by using a bad aspnet_regiis command line.
> > >
> > >GREATLY APPRECIATED!!!!!!
>
>
> Ooops, more questions.
>
> So is it that the latest/new site will respond to http://localhost?
> Why would http://localhost/MySite\login.aspx not work in this instance.
>
> I guess maybe an understanding of the ServerBindings property would
> help.
>
> I wonder if ServerBindings could be set to act on
> http://localhost/MySite/login.aspx??


Re: VB.NET code needed to get IIS Site ID by Superfreak3

Superfreak3
Fri Jan 19 11:16:24 CST 2007


Superfreak3 wrote:
> Kristofer Gafvert wrote:
> > Hello,
> >
> > http://localhost/ does not necessarily has to be tied to the "Default
> > Website". That is determined by the ServerBindings property. If you
> > created a new website, and the new website is listening on "localhost", it
> > will be this website responding.
> >
> > This has nothing to do with the aspnet_regiis command.
> >
> > --
> > Regards,
> > Kristofer Gafvert
> > http://www.gafvert.info/iis/ - IIS Related Info
> >
> >
> > Superfreak3 wrote:
> >
> > >
> > >Kristofer Gafvert wrote:
> > >>See my other example here:
> > >>
> > >>"C# - Find website ID by name"
> > >>http://www.gafvert.info/iis/article/cs_find_id_by_name.htm
> > >>
> > >>You cannot have a website beneath "Default Website". That is a virtual
> > >>directory (or just a directory), both on a client OS and a server OS. So
> > >>it does not have a website ID, only websites have this.
> > >>
> > >>So if you need to configure something on the virtual directory (and not
> > >>globally on the website), you will need to figure out a way to get the
> > >>virtual directory.
> > >>
> > >>--
> > >>Regards,
> > >>Kristofer Gafvert
> > >>http://www.gafvert.info/iis/ - IIS Related Info
> > >>
> > >>
> > >>Superfreak3 wrote:
> > >>
> > >>>
> > >>>Kristofer Gafvert wrote:
> > >>>>It will return the ID for the website(s).
> > >>>>
> > >>>>--
> > >>>>Regards,
> > >>>>Kristofer Gafvert
> > >>>>http://www.gafvert.info/iis/ - IIS Related Info
> > >>>>
> > >>>>
> > >>>>Superfreak3 wrote:
> > >>>>
> > >>>>>
> > >>>>>Kristofer Gafvert wrote:
> > >>>>>>Hi,
> > >>>>>>
> > >>>>>>I have an example of this in C#, it should not be that hard to
> > >>>>>>translate
> > >>>>>>it into VB.NET.
> > >>>>>>
> > >>>>>>"C# - Enumerate websites"
> > >>>>>>http://www.gafvert.info/iis/article/cs_enum_iis_websites.htm
> > >>>>>>
> > >>>>>>--
> > >>>>>>Regards,
> > >>>>>>Kristofer Gafvert
> > >>>>>>http://www.gafvert.info/iis/ - IIS Related Info
> > >>>>>>
> > >>>>>>
> > >>>>>>Superfreak3 wrote:
> > >>>>>>
> > >>>>>>>Is there a way to get the Site ID for an IIS web site with VB.NET
> > >>>>>>>code?
> > >>>>>>> What I would like to do is get the site id number then call
> > >>>>>>>aspnet_regiis with the -s option to set the ASP.NET version of the
> > >>>>>>>site
> > >>>>>>>to 2.0.50727 based on this site ID with.
> > >>>>>>>
> > >>>>>>>Any help or sample code would be GREATLY appreciatted!!
> > >>>>>>>
> > >>>>>>>Thanks!
> > >>>>>
> > >>>>>Since this looks pretty simple, although I should say I'm no code guru,
> > >>>>>will this return the numerical id that is needed for use in my
> > >>>>>aspnet_regiis command.
> > >>>
> > >>>If I know the name of the web site, how can I simply grab its Site ID.
> > >>>Also, if installed on a non-server OS, the site appears as a virtual
> > >>>directory under the Default Web Site. Is the ID found in the same way
> > >>>or will it carry the 1 of the default site?
> > >>>
> > >>>Thanks for the info so far!!!
> > >
> > >Would you know the answer to this question as I don't know if the
> > >'problem' is tied to my attempted use of aspnet_regiis or not.
> > >
> > >On a server system, it appears in IIS that our site is in addition to
> > >the Default Web Site as it doesn't appear as a sub/virtual directory to
> > >it in the tree. However, when we launch http://localhost, our site is
> > >launched. The developer would have expected the call to require
> > >http://localhost/OurSite/login.aspx.
> > >
> > >Do you think I might have done something by using w3svc/1/root/OurSite
> > >in the aspnet_regiis command?
> > >
> > >I'm trying to determine if its a setting in my install program (Wise
> > >for Windows Installer) that is incorrect or if I messed up the
> > >hierarchy by using a bad aspnet_regiis command line.
> > >
> > >GREATLY APPRECIATED!!!!!!
>
>
> Ooops, more questions.
>
> So is it that the latest/new site will respond to http://localhost?
> Why would http://localhost/MySite\login.aspx not work in this instance.
>
> I guess maybe an understanding of the ServerBindings property would
> help.
>
> I wonder if ServerBindings could be set to act on
> http://localhost/MySite/login.aspx??

I guess the way it looks, I need my little utility to run the
aspnet_regiis utility to determine if our site is a Virtual Directory
or actual site then run the aspnet_regiis utility with the correct
command line containing the correct site ID.


Re: VB.NET code needed to get IIS Site ID by Superfreak3

Superfreak3
Fri Jan 19 15:04:22 CST 2007


Kristofer Gafvert wrote:
> Hello,
>
> http://localhost/ does not necessarily has to be tied to the "Default
> Website". That is determined by the ServerBindings property. If you
> created a new website, and the new website is listening on "localhost", it
> will be this website responding.
>
> This has nothing to do with the aspnet_regiis command.
>
> --
> Regards,
> Kristofer Gafvert
> http://www.gafvert.info/iis/ - IIS Related Info
>

Is there any way to prevent this? I'm just worried about how creating
our new site on a system will effect a system housing several sites.

Is there any way to force the http://localhost/MySite/Page_Login.aspx?
This is what I have to use on my test system (non-Server OS) but on a
true server test system, its forcing http://localhost.

I guess I'm a bit confused at this point, but if I can get over this
hurdle (and setting the asp.net version) I could be home free.

Thanks for all the help so far!!


Re: VB.NET code needed to get IIS Site ID by Superfreak3

Superfreak3
Fri Jan 19 15:41:32 CST 2007


Superfreak3 wrote:
> Kristofer Gafvert wrote:
> > Hello,
> >
> > http://localhost/ does not necessarily has to be tied to the "Default
> > Website". That is determined by the ServerBindings property. If you
> > created a new website, and the new website is listening on "localhost", it
> > will be this website responding.
> >
> > This has nothing to do with the aspnet_regiis command.
> >
> > --
> > Regards,
> > Kristofer Gafvert
> > http://www.gafvert.info/iis/ - IIS Related Info
> >
>
> Is there any way to prevent this? I'm just worried about how creating
> our new site on a system will effect a system housing several sites.
>
> Is there any way to force the http://localhost/MySite/Page_Login.aspx?
> This is what I have to use on my test system (non-Server OS) but on a
> true server test system, its forcing http://localhost.
>
> I guess I'm a bit confused at this point, but if I can get over this
> hurdle (and setting the asp.net version) I could be home free.
>
> Thanks for all the help so far!!

Also, it seems my site will only function on Port 80???


Re: VB.NET code needed to get IIS Site ID by Kristofer

Kristofer
Sun Jan 21 07:23:02 CST 2007

When you create a new website, you specify what IP, Port and host header
the new site should listen on. If what you specify is already used by
another website (the IP, port and host header must be a unique
combination), you will not be able to run both sites simultaneously.

So really, you, when you create the new website in your setup application,
do all this. It is not the "latest" website created responding to
http://localhost/.

So your first step is to figure out if you want a new website to be
created, or if it should be a virtual directory. Because at this point, i
cannot understand what you really want to happen.

But whatever you do, you do it in your setup application. IIS does not
assume anything.

--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info


Superfreak3 wrote:

>
>Kristofer Gafvert wrote:
>>Hello,
>>
>>http://localhost/ does not necessarily has to be tied to the "Default
>>Website". That is determined by the ServerBindings property. If you
>>created a new website, and the new website is listening on "localhost", it
>>will be this website responding.
>>
>>This has nothing to do with the aspnet_regiis command.
>>
>>--
>>Regards,
>>Kristofer Gafvert
>>http://www.gafvert.info/iis/ - IIS Related Info
>>
>
>Is there any way to prevent this? I'm just worried about how creating
>our new site on a system will effect a system housing several sites.
>
>Is there any way to force the http://localhost/MySite/Page_Login.aspx?
>This is what I have to use on my test system (non-Server OS) but on a
>true server test system, its forcing http://localhost.
>
>I guess I'm a bit confused at this point, but if I can get over this
>hurdle (and setting the asp.net version) I could be home free.
>
>Thanks for all the help so far!!

Re: VB.NET code needed to get IIS Site ID by Superfreak3

Superfreak3
Sun Jan 21 16:53:04 CST 2007


Kristofer Gafvert wrote:
> When you create a new website, you specify what IP, Port and host header
> the new site should listen on. If what you specify is already used by
> another website (the IP, port and host header must be a unique
> combination), you will not be able to run both sites simultaneously.
>
> So really, you, when you create the new website in your setup application,
> do all this. It is not the "latest" website created responding to
> http://localhost/.
>
> So your first step is to figure out if you want a new website to be
> created, or if it should be a virtual directory. Because at this point, i
> cannot understand what you really want to happen.
>
> But whatever you do, you do it in your setup application. IIS does not
> assume anything.
>
> --
> Regards,
> Kristofer Gafvert
> http://www.gafvert.info/iis/ - IIS Related Info
>
>
> Superfreak3 wrote:
>
> >
> >Kristofer Gafvert wrote:
> >>Hello,
> >>
> >>http://localhost/ does not necessarily has to be tied to the "Default
> >>Website". That is determined by the ServerBindings property. If you
> >>created a new website, and the new website is listening on "localhost", it
> >>will be this website responding.
> >>
> >>This has nothing to do with the aspnet_regiis command.
> >>
> >>--
> >>Regards,
> >>Kristofer Gafvert
> >>http://www.gafvert.info/iis/ - IIS Related Info
> >>
> >
> >Is there any way to prevent this? I'm just worried about how creating
> >our new site on a system will effect a system housing several sites.
> >
> >Is there any way to force the http://localhost/MySite/Page_Login.aspx?
> >This is what I have to use on my test system (non-Server OS) but on a
> >true server test system, its forcing http://localhost.
> >
> >I guess I'm a bit confused at this point, but if I can get over this
> >hurdle (and setting the asp.net version) I could be home free.
> >
> >Thanks for all the help so far!!

Our intention is to create a new web site. I read somewhere that this
will be created as a Virtual Directory on a non-Server Operating
system. Is this true?

Our installation authoring tool, Wise for Windows Installer presents
different dialogs based on the operating system as well.


Re: VB.NET code needed to get IIS Site ID by Superfreak3

Superfreak3
Sun Jan 21 17:17:30 CST 2007


Superfreak3 wrote:
> Kristofer Gafvert wrote:
> > When you create a new website, you specify what IP, Port and host header
> > the new site should listen on. If what you specify is already used by
> > another website (the IP, port and host header must be a unique
> > combination), you will not be able to run both sites simultaneously.
> >
> > So really, you, when you create the new website in your setup application,
> > do all this. It is not the "latest" website created responding to
> > http://localhost/.
> >
> > So your first step is to figure out if you want a new website to be
> > created, or if it should be a virtual directory. Because at this point, i
> > cannot understand what you really want to happen.
> >
> > But whatever you do, you do it in your setup application. IIS does not
> > assume anything.
> >
> > --
> > Regards,
> > Kristofer Gafvert
> > http://www.gafvert.info/iis/ - IIS Related Info
> >
> >
> > Superfreak3 wrote:
> >
> > >
> > >Kristofer Gafvert wrote:
> > >>Hello,
> > >>
> > >>http://localhost/ does not necessarily has to be tied to the "Default
> > >>Website". That is determined by the ServerBindings property. If you
> > >>created a new website, and the new website is listening on "localhost", it
> > >>will be this website responding.
> > >>
> > >>This has nothing to do with the aspnet_regiis command.
> > >>
> > >>--
> > >>Regards,
> > >>Kristofer Gafvert
> > >>http://www.gafvert.info/iis/ - IIS Related Info
> > >>
> > >
> > >Is there any way to prevent this? I'm just worried about how creating
> > >our new site on a system will effect a system housing several sites.
> > >
> > >Is there any way to force the http://localhost/MySite/Page_Login.aspx?
> > >This is what I have to use on my test system (non-Server OS) but on a
> > >true server test system, its forcing http://localhost.
> > >
> > >I guess I'm a bit confused at this point, but if I can get over this
> > >hurdle (and setting the asp.net version) I could be home free.
> > >
> > >Thanks for all the help so far!!
>
> Our intention is to create a new web site. I read somewhere that this
> will be created as a Virtual Directory on a non-Server Operating
> system. Is this true?
>
> Our installation authoring tool, Wise for Windows Installer presents
> different dialogs based on the operating system as well.

Also, here are some more questions... Does each website have to have a
different port assigned? If on a non-Server OS, where our 'site' will
be installed as a Virtual Directory, will this operate on the same port
as the Default Web Site, 80, for example.

Also, as an additional response to the question of our intentions....
our new web site should not conflict with any existing web sites on the
target system.

Thanks again!!

You're information is quite HELPFUL!!!


Re: VB.NET code needed to get IIS Site ID by Kristofer

Kristofer
Mon Jan 22 00:28:40 CST 2007

No, it is not true, unless you specify that your setup application creates
a virtual directory instead of a website on a client OS.

But this may be a feature of Wise for Windows Installer (i.e. it
automatically creates a virtual directory instead of a website on a client
OS, without you needing to specify anything).

--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info


Superfreak3 wrote:

>
>Kristofer Gafvert wrote:
>>When you create a new website, you specify what IP, Port and host header
>>the new site should listen on. If what you specify is already used by
>>another website (the IP, port and host header must be a unique
>>combination), you will not be able to run both sites simultaneously.
>>
>>So really, you, when you create the new website in your setup application,
>>do all this. It is not the "latest" website created responding to
>>http://localhost/.
>>
>>So your first step is to figure out if you want a new website to be
>>created, or if it should be a virtual directory. Because at this point, i
>>cannot understand what you really want to happen.
>>
>>But whatever you do, you do it in your setup application. IIS does not
>>assume anything.
>>
>>--
>>Regards,
>>Kristofer Gafvert
>>http://www.gafvert.info/iis/ - IIS Related Info
>>
>>
>>Superfreak3 wrote:
>>
>>>
>>>Kristofer Gafvert wrote:
>>>>Hello,
>>>>
>>>>http://localhost/ does not necessarily has to be tied to the "Default
>>>>Website". That is determined by the ServerBindings property. If you
>>>>created a new website, and the new website is listening on "localhost",
>>>>it
>>>>will be this website responding.
>>>>
>>>>This has nothing to do with the aspnet_regiis command.
>>>>
>>>>--
>>>>Regards,
>>>>Kristofer Gafvert
>>>>http://www.gafvert.info/iis/ - IIS Related Info
>>>>
>>>
>>>Is there any way to prevent this? I'm just worried about how creating
>>>our new site on a system will effect a system housing several sites.
>>>
>>>Is there any way to force the http://localhost/MySite/Page_Login.aspx?
>>>This is what I have to use on my test system (non-Server OS) but on a
>>>true server test system, its forcing http://localhost.
>>>
>>>I guess I'm a bit confused at this point, but if I can get over this
>>>hurdle (and setting the asp.net version) I could be home free.
>>>
>>>Thanks for all the help so far!!
>
>Our intention is to create a new web site. I read somewhere that this
>will be created as a Virtual Directory on a non-Server Operating
>system. I