473,396 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to set the framework version with IISVDIR ?

Hello

I wrote a script which uses IISVDIR to add the .NET projects to the IIS.

The problem is that some ASPX solutions are written for framework 1.1
and others for framework 2.0.

I could not find a way how to programmatically set the framework
version.

Currently my script is quite useless as all framework 2.0 projects will
not run. I have to MANUALLY change the framework in the IIS Adminisrtator.

I want to run that 100% automatically.

Can anybody help me, please ?
Thanks.

Elmü
Jun 27 '08 #1
5 1945
Hello

I already found that the command

c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspn et_regiis.exe
-s w3svc/553851221/root/Path/MyAspxSolution

does what I need: convert an already existing 1.1 project into a 2.0
Project.

But where do I get the metabase number 553851221 from ?

All samples in the internet use a 1 (one) instead.
(w3svc/1/root)
But this does not work on my server.
Why does Microsoft make all so unneccesary complicated ??
I hate them!

Elmü


Jun 27 '08 #2
re:
!But where do I get the metabase number 553851221 from ?

Run :

aspnet_regiis -lk

That will list the correct data you want, in the format :

W3SVC/somenumber/ROOT/AppName/ .NetVersionNumber


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Elmue" <ab***@gmx.dewrote in message news:eu**************@TK2MSFTNGP05.phx.gbl...
Hello

I already found that the command

c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspn et_regiis.exe
-s w3svc/553851221/root/Path/MyAspxSolution

does what I need: convert an already existing 1.1 project into a 2.0
Project.

But where do I get the metabase number 553851221 from ?

All samples in the internet use a 1 (one) instead.
(w3svc/1/root)
But this does not work on my server.
Why does Microsoft make all so unneccesary complicated ??
I hate them!

Elmü


Jun 27 '08 #3
Yeah !
I've got it !

The strange metabase number 553851221 seems to be a Hash which is
calculated from the name of the website.

It is only "1" if you run your webservice in the "Predefined Websites"

If I change the name the magic number also changes.
If I use the old name again the number is the same again.

So it is safe to use this number in your scripts as long as the name of
the website does not change in your script:

IIsWeb /create D:\Path\RootFolder "NameOfWebSite" /b 80

To get a list of all WebSites you can use this .NET code:
using System.DirectoryServices;

DirectoryEntry i_Parent = new DirectoryEntry("IIS://localhost/w3svc");

foreach (DirectoryEntry i_Entry in i_Parent.Children)
{
string s_Path = i_Entry.Path;

if (i_Entry.SchemaClassName == "IIsWebServer")
{
string s_Comment = i_Entry.Properties["ServerComment"]
.Value.ToString();

foreach (DirectoryEntry i_Dir in i_Entry.Children)
{
if (i_Dir.SchemaClassName == "IIsWebVirtualDir")
{
...
}
}
}
else if ((i_Entry.SchemaClassName == "IIsWebVirtualDir") ||
(i_Entry.SchemaClassName == "IIsWebDirectory"))
{
...
}
}
Elmü
Jun 27 '08 #4
Hello

Now that my script has moved the website to run on framework 2.0
it still does not work.

Error: "The service is not available!"

I still have to manually set the AppPool to a pool that runs framework 2.0.

How can I change the Default App Pool for only one website via a script?

I havn't got a glimpse.

Elmú
Jun 27 '08 #5
After one entire day of investigation I also solved the last problem:

Put this into a file "SetAppPool.vbs"
option explicit

Const GENERAL_FAILURE = 2
Const POOLED_PROCESS = 2
Const CREATE_POOL_IF_NOT_EXIST = true

If WScript.Arguments.Count < 2 Then
WScript.Echo
WScript.Echo
"-------------------------------------------------------------------------"
WScript.Echo "This script assigns a Web Application to a pool"
WScript.Echo "Usage: SetAppPool MetaPath PoolName"
WScript.Echo "If the name contains spaces the name must be enclosed
in quotation marks."
WScript.Echo "Example:"
WScript.Echo "SetAppPool W3SVC/553851221/Root/AppName Net2Pool"
WScript.Echo
"-------------------------------------------------------------------------"
WScript.Echo
WScript.Quit (GENERAL_FAILURE)
End If

Dim sWebApp
sWebApp = "IIS://localhost/" & WScript.Arguments.Item(0)

Dim IIsWebVDirObj
Set IIsWebVDirObj = GetObject(sWebApp)

IIsWebVDirObj.AppCreate3 POOLED_PROCESS, WScript.Arguments.Item(1),
CREATE_POOL_IF_NOT_EXIST
IIsWebVDirObj.SetInfo

Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: fripper | last post by:
I have installed Visual Studio .Net 2003 on top of an earlier version. Now, when I open a new project I get a message that says Visual Studio .NET has detected that the web server is running...
2
by: j.b.messina | last post by:
This has not yet been published by Microsoft. It will be published within the next few weeks, mainly because I asked them to. I felt this was information badly needed, and I think this is the...
9
by: Tim D | last post by:
Hi, I originally posted this as a reply to a rather old thread in dotnet.framework.general and didn't get any response. I thought it might be more relevant here; anyone got any ideas? My...
1
by: Harry Simpson | last post by:
I know I drilled down into the Windows folder\Microsoft.net\Framework\v1.1.4322 folder and looked at the version of Mscorcfg.dll to get the SP level from the version number: Mine shows...
23
by: Nak | last post by:
Hi there, Has anyone any ideas if the next Framework will be an update to version 1.1 or another completely new install so that people have 3 Frameworks on their system? And can VS.NET 2003 be...
5
by: Steve Sprague | last post by:
I have a .Net Framework question. I have installed VB.NET version 1.0.3705 I tried to install a small tutorial utillity. It told me I first needed to upgrade my Framework Version. So I went to...
3
by: Shadow Lynx | last post by:
At the bottom of the default Error page that appears when Unhandled Exceptions occur, what exactly is the difference between the "Microsoft ..Net Framework Version" and the "ASP.NET Version"? I...
13
by: dancer | last post by:
I have made a new post because when I try to respond to another, I get the error, "Article Rejected -- Ill-formed message id" This is in response to the advice of Juan Libre to install Net...
11
by: pg | last post by:
My old HD crashes, so I had to do a total re-install. After installer XP, I went to the Micrsoft Update site to get all the update. After 5 hours or so ... the update cycle started looping. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.