First steps in running ASP.NET on IIS
First steps in running ASP.NET on IIS
am 05.07.2007 17:34:04 von m_j_sorens
I am attempting to set up IIS on WinXpPro (and thus IIS 5.1). I installed IIS
and I could bring up the default home page via http://localhost. I then read
how to set up a virtual directory and created one called demo1. I also
twiddled properites for Default Web Site and (I think) enabled ASP.NET by
selecting the sole choice from the drop-down box on the ASP.NET tab. I then
created a simple html page "trial1" and stored it both as a .html and as a
..aspx in the root directory for demo1.
Observations:
(1) Loading http://localhost/demo1/trial1.html yields "You are not
authorized to view this page"
(2) Loading http://localhost/demo1/trial1.aspx yields "Server Application
Unavailable".
(3) If I move trial1.html to C:\Inetpub\wwwroot, then
http://localhost/trial1.html works OK.
(4) If I move trial1.aspx to C:\Inetpub\wwwroot, it still yields the error
"Server Application Unavailable".
(5) Loading the default asp file http://localhost/localstart.asp works OK
(curiously though it first asks me for my login credentials on my corporate
network).
Here are the steps I used to create my virtual directory:
(1) Launch inetmgr
(2) Select Default Web Site in navigator
(3) Action >> New >> Virtual Directory
(4) alias = demo1
(5) path = C:\Documents and Settings\msorens\My Documents\Visual Studio
2005\WebSites\HelloWorld
(6) permissions = Read, Run scripts, Execute
So I have two issues with which I need assistance:
(A) Virtual directory settings not correct (since I could not even load an
HTML file).
(b) ASP.NET settings not correct (since I could not run any ASPX files).
I have searched the web for startup tutorials for IIS but have found nothing
that really addresses the very first steps. Suggestions would be appreciated.
Re: First steps in running ASP.NET on IIS
am 05.07.2007 22:12:38 von Kristofer Gafvert
Hello,
I will answer your questions below.
A) The permission problem is most likely appearing because
IUSR_Machinename does not have permissions to access files in your
profile. I would not recommend you to grant this user account access to
your files. Instead i would recommend you to publish your website in a
folder outside of your profile (C:\inetpub\wwwroot\demo1 would be fine)
B) It is not possible to say what the problem is. It has probably
something to do with (A), but a detailed error message should be logged in
the event log that would tell us what is wrong. Please check there, and if
you cannot understand it, post it here.
--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info
michael sorens wrote:
>I am attempting to set up IIS on WinXpPro (and thus IIS 5.1). I installed
>IIS
>and I could bring up the default home page via http://localhost. I then
>read
>how to set up a virtual directory and created one called demo1. I also
>twiddled properites for Default Web Site and (I think) enabled ASP.NET by
>selecting the sole choice from the drop-down box on the ASP.NET tab. I then
>created a simple html page "trial1" and stored it both as a .html and as a
>.aspx in the root directory for demo1.
>Observations:
>(1) Loading http://localhost/demo1/trial1.html yields "You are not
>authorized to view this page"
>(2) Loading http://localhost/demo1/trial1.aspx yields "Server Application
>Unavailable".
>(3) If I move trial1.html to C:\Inetpub\wwwroot, then
>http://localhost/trial1.html works OK.
>(4) If I move trial1.aspx to C:\Inetpub\wwwroot, it still yields the error
>"Server Application Unavailable".
>(5) Loading the default asp file http://localhost/localstart.asp works OK
>(curiously though it first asks me for my login credentials on my corporate
>network).
>
>Here are the steps I used to create my virtual directory:
>(1) Launch inetmgr
>(2) Select Default Web Site in navigator
>(3) Action >> New >> Virtual Directory
>(4) alias = demo1
>(5) path = C:\Documents and Settings\msorens\My Documents\Visual Studio
>2005\WebSites\HelloWorld
>(6) permissions = Read, Run scripts, Execute
>
>So I have two issues with which I need assistance:
>(A) Virtual directory settings not correct (since I could not even load an
>HTML file).
>(b) ASP.NET settings not correct (since I could not run any ASPX files).
>
>I have searched the web for startup tutorials for IIS but have found
>nothing
>that really addresses the very first steps. Suggestions would be
>appreciated.
Re: First steps in running ASP.NET on IIS
am 06.07.2007 00:50:01 von m_j_sorens
(A) I moved the folder outside the profile, as you suggested, and now the
HTML page works (http://localhost/demo1/trial1.html).
(B) I reviewed the event log. For http://localhost/trial1.aspx (i.e. file at
c:\inetpub\wwwroot\trial1.aspx), a warning and an event were generated, shown
here:
=======================
Failed to execute request because the App-Domain could not be created.
Error: 0x80131902
Failed to initialize the AppDomain:/LM/W3SVC/1/ROOT
Exception: System.Configuration.ConfigurationErrorsException
Message: Exception of type
'System.Configuration.ConfigurationErrorsException' was thrown.
StackTrace: at
System.Web.Configuration.ErrorRuntimeConfig.ErrorConfigRecor d.System.Configuration.Internal.IInternalConfigRecord.GetLkg Section(String configKey)
at . . .
=============================
That is probably not worth worrying about because the file is not in the
right place. So when I move the file inside the new virtual directory, i.e.
(http://localhost/demo1/trial1.aspx) then it gets a bit farther, returning an
on-screen error page:
=============================
Server Error in '/demo1' Application.
Failed to access IIS metabase.
The process account used to run ASP.NET must have read access to the IIS
metabase ...
=============================
It further pointed to a KB article talking about metaacl.exe, but that also
mentioned one could just run "aspnet_regiis âga " to
grant permissions. (Is this permissions for me specifically, or for the
server, or...? )
I found one other reference on the web that said I need to run these two
commands:
%windir%\Microsoft.NET\Framework\vxxxxxx\aspnet_regiis.exe -i
regsvr32 %windir%\Microsoft.NET\Framework\vxxxxxx\aspnet_isapi.dll
Which is correct? Is there any well-written "configuring ASP.NET" document
out there?
Re: First steps in running ASP.NET on IIS
am 06.07.2007 12:24:07 von wjzhang
Hi,
The problem may be cuased by there is an AdminACL property under the site
level which isn't inherited from W3SVC root node. ASP.net installation
onlys add permission for ASPNET account on the W3SVC. In this case, you
will get the "Failed to access IIS metabase" error.
To fix the problem, please try the following:
1. Open a CMD prompt.
2. Change to the c:\inetpub\AdminScripts folder.
3. Type "cscript adsutil.vbs delete w3svc/1/AdminACL".
Then please running aspnet_regiis -u and delete the aspnet account in
computer management. After that run aspnet_regiis -i and aspnet_regiis -ga
to recreate the account and bind ASP.net will iis.
The MetaEdit tool will help on checking IIS metabase configurations:
How To Install MetaEdit 2.2 on Windows NT 4.0 or Windows 2000
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q301 386&sd=tech
Have a nice weekend.
Sincerely,
WenJun Zhang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/de fault.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at:
http://msdn.microsoft.com/subscriptions/support/default.aspx .
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Re: First steps in running ASP.NET on IIS
am 06.07.2007 22:18:04 von m_j_sorens
I am hesitant to to just run commands I do not understand, particularly when
you are now giving a third version that is just a bit different from the
other two I found on the web. There must be official documentation on how to
set up ASP.NET with IIS; could you please provide a URL so I could
walkthrough the documentation and gain an understanding while I do it?
Re: First steps in running ASP.NET on IIS
am 09.07.2007 11:00:43 von wjzhang
Unfortunately there isn't a specific article on this. Adsutil.vbs is the
script tool we usually use to modify IIS metabase configurations. AdminACL
property is similar to File System NTFS ACL(access control list) which
contains the info of which accounts have what permission on a metabase
entry. The Adsutil.vbs command in my previous thread is in order to delete
the permission set(AdminACL) under Default Web Site level to make it
inherit from W3SVC global setting.
Using the Adsutil.vbs Administration Script (IIS 6.0)
http://www.microsoft.com/technet/prodtechnol/WindowsServer20 03/Library/IIS/d
3df4bc9-0954-459a-b5e6-7a8bc462960c.mspx?mfr=true
AdminACL Metabase Property (IIS 6.0)
http://www.microsoft.com/technet/prodtechnol/WindowsServer20 03/Library/IIS/7
91d575e-5364-45a9-90ef-4dfd23f38d67.mspx?mfr=true
For aspnet_regiis:
aspnet_regiis -u // the command unregister ASP.net with IIS
aspnet_regiis -i // the command reinstalls ASP.net mapping
aspnet_regiis -ga ASPNET //the command recreate and set permission for
ASPNET account
ASP.NET IIS Registration Tool (Aspnet_regiis.exe)
http://msdn2.microsoft.com/en-us/library/k6h9cz8h(VS.80).asp x
Thanks.
Sincerely,
WenJun Zhang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/de fault.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at:
http://msdn.microsoft.com/subscriptions/support/default.aspx .
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Re: First steps in running ASP.NET on IIS
am 09.07.2007 17:40:01 von m_j_sorens
(1) Let me first restate my documentation request. I find it very hard to
believe that there is no documentation on how to set up IIS and ASP.NET.
(Note that I am not asking on specific docs on handling my error.)
(2) In an attempt to probe into this issue a bit more, I started from the
bottom with just the following.
============================================================ =================================
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis. exe -ga ASPNET
Start granting ASPNET access to the IIS metabase and other directories used
by ASP.NET.
An error has occurred: 0x800706fd The trust relationship between this
workstation and the primary domain failed.
============================================================ =================================
I then went back a bit farther and added the unregister/register steps:
============================================================ =================================
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis. exe -u
Start uninstalling ASP.NET (2.0.50727).
...............
Finished uninstalling ASP.NET (2.0.50727).
Setup has detected some errors during the operation. For details, please
read the setup log file
C:\DOCUME~1\msorens\LOCALS~1\Temp\ASPNETSetup_00000.log
[This log file showed the same error about the trust relationship.]
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis. exe -i
Start installing ASP.NET (2.0.50727).
..........................
Finished installing ASP.NET (2.0.50727).
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis. exe -ga ASPNET
Start granting ASPNET access to the IIS metabase and other directories used
by ASP.NET.
Finished granting ASPNET access to the IIS metabase and other directories
used by ASP.NET.
============================================================ =================================
As the -i and -ga steps did not report errors, I then tried the .aspx page
in the browser and it succeeded.
Here is one other difference I noted. I show the output of -lv and -lk
invocations, both before I ran the above changes and after.
Are the results shown here what one should expect, even though I did not run
the adsutil.vbs utility?
============================================================ =================================
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis. exe -lv
============================================================ =================================
BEFORE:
2.0.50727.0 Valid
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.d ll
AFTER:
2.0.50727.0 Valid (Root)
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.d ll
============================================================ =================================
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis. exe -lk
============================================================ =================================
BEFORE:
W3SVC/1/ROOT/ 2.0.50727.0
AFTER
W3SVC/ 2.0.50727.0
W3SVC/1/ROOT/ 2.0.50727.0
W3SVC/1/ROOT/Printers/ 2.0.50727.0
Re: First steps in running ASP.NET on IIS
am 11.07.2007 16:15:19 von wjzhang
Hi,
This is the first time I saw aspnet_regiis reports this error. I will ping
my ASP.net group colleagues to discuss it.
By the way, could you please provide me with your valid email address? I'd
like to talke with you offline on the further troubleshooting. My email is:
wjzhang@online.microsoft.com (please remove online.)
Thanks.
Sincerely,
WenJun Zhang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/de fault.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at:
http://msdn.microsoft.com/subscriptions/support/default.aspx .
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Re: First steps in running ASP.NET on IIS
am 16.07.2007 15:11:41 von stcheng
Hi Michael,
It seems that you can not get the ASP.NET application running on a windows
xp pro box. As you mentioned that the document about setup ASP.NET to work
in IIS is quite limited. Here is a walkthrough in MSDN on configuring
ASP.NET application(include IIS virutal dir setting):
#ASP.NET Application Walkthrough
http://msdn2.microsoft.com/EN-US/library/aa719551(VS.71).asp x
Also, normally, with default setting(for both IIS5 or II6), it require very
view configuration we need to do when deploy ASP.NET application in IIS as
long as the environment is setup correctly(include IIS and .net framework
installation). Generally, you've the following means to deploy ASP.NET
application:
** use VS IDE to create or publsh web application if you have one installed
** xcopy the web application folder to target place and make it an
application virtual directory in IIS(set the correct application pool and
ASP.NET version).
If the setup is correct, default setting (such as process identity) should
work correctly, no more action is needed.
So for your problem, I guess there maybe something wrong with the
environment. Regardless of the problem process identtity(the default
MACHINE\ASPNET) one, you can try chaning the ASP.NET process identity to
"local system" account and run it. To change the process identity (for
IIS5), you need to change the "username" attribute of
element to "SYSTEM" in machine.config file:
# Element
http://msdn2.microsoft.com/en-us/library/7w2sway1(VS.71).asp x
If LOCAL SYSTEM account can work, that means there does be something
incorrect with the default process identity(machine\ASPNET). Otherwise,
there might be something else incorrect with the ASP.Net or .net framework
setup.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Re: First steps in running ASP.NET on IIS
am 17.07.2007 18:34:03 von m_j_sorens
Thanks for the information but I think you both missed the fact that I got
the aspx page working. About midway in my last reply I stated " I then tried
the .aspx page in the browser and it succeeded." I then followed that with a
single question of more or less academic interest.
Re: First steps in running ASP.NET on IIS
am 18.07.2007 05:03:53 von stcheng
Hi Michael,
Thanks for your further explanation. Yes, I originally focus on the problem
you mentioned earlier. Anyway, I just want to know whether you still any
further specific questions or any other problems need help. If so, please
don't hesitate to let me know. I'll be glad to assist.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Re: First steps in running ASP.NET on IIS
am 18.07.2007 20:48:01 von m_j_sorens
Well, yes, I have stated twice now that I have a question: Are the results I
displayed from "aspnet_regiis.exe -lv" and "aspnet_regiis.exe -lk" what one
should expect, given that I had the strange problem discussed earlier?
Re: First steps in running ASP.NET on IIS
am 19.07.2007 11:21:18 von stcheng
Thanks for your reply Michael,
For the aspnet_regiis -lv and -lk, I think the output you get is expected(I
just focus on the AFTER case as I haven't tested the BEFORE case).
Based on the document, you can find the funcationlity of the two command
options:
-lk
Lists the path and version of all IIS metabase keys where ASP.NET is
mapped. So you can use it to verify how many version of ASP.NET has been
installed(e.g V1.1, V2.0...) and where is the physical location of the
ASP.NET components(include the aspnet_isapi.dll )
-lv
Lists the status and installation path of all versions of ASP.NET that are
installed on the computer. So you can use it to check the ASP.NET extension
mappings in IIS site hierarchy. Whether the certain site(or virtual
directory) has been mapped to the correct ASP.NET version. Note that this
command only display the mapping for the current ASP.NET version(matches
the aspnet_regiis.exe ). e.g. If you execute the aspnet_regiis.exe under
..net 2.0 folder, it will only show all the paths that has been reigstred
with ASP.NET 2.0 in IIS.
To conclude, these two options doesn't conflict with each other and each of
them provide its own information(you should not think them exclusive).
If you have any further questions on this, welcome to post here.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Re: First steps in running ASP.NET on IIS
am 23.07.2007 04:47:34 von wawang
Hi,
I'm writing to check the status of this post, please feel free to let us
know if there's anything else we can do. Thanks.
Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Re: First steps in running ASP.NET on IIS
am 23.07.2007 15:22:04 von m_j_sorens
That takes care of all my questions for now. If I run into further issues, I
may be back. :-)
"Walter Wang [MSFT]" wrote:
> Hi,
>
> I'm writing to check the status of this post, please feel free to let us
> know if there's anything else we can do. Thanks.
>
>
> Regards,
> Walter Wang (wawang@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
>
> ==================================================
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>