how to check whether asp.net is installed/enabled with c#?

Z

zimmy

Hi,

Is it possible to check whether ASP.NET is installed on a machine,
within a program that I'm writing in C#? And if it's installed, can I
check if it is enabled? How?

Thanks
 
L

Lau Lei Cheong

Just run a simple ASPX page on your web server. If it works, ASP .NET
is installed correctly.
 
Z

zimmy

I need to do the check in a program, as a verification step to ensure
that everything has been set up correctly. I don't want to ask the
user to manually go check if ASP.NET has been installed and enabled.
It would be nice if I can do that from within the program
automatically.

Is there any API for doing this sort of thing?

Thanks!
 
L

Lau Lei Cheong

oic...

If this is the case, I'll suggest you to see if
WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe is present, and
run it if it's there.

If the first case fails, it seems .NET framework is not installed at all.

If the second returns no error code, there should be no problem in the
settings.

I think it doesn't cause harm to run aspnet_regiis more than once. Though
there should be better ideas.
 
Z

zimmy

Thanks, this seems like it could work. But does anyone out there know if
the functionality of aspnet_regiis.exe is available through an API (for
C#), so I don't have to call an external program?
 
E

Elizabeth Newman [MS]

If you are trying to determine if the .Net Framework is installed on the computer before installing your application, you can use a web setup project. When an msi is run
that has been created by a web setup project, it will automatically check to see if the .NET FX is installed. If not, a message box will appear with a link to a web page
where the FX may be downloaded. If you are not familar with setup projects, a good walkthough may be found at http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/vsintro7/html/vbconcreatingoraddingdeploymentprojects.asp.

Hope this helps,
Elizabeth Newman


--------------------
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top