473,734 Members | 2,788 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

creating website programmaticall y using C#

Hi,

I have written some code in C# to programmaticall y create a website
and an application pool. Both seems to be getting created alright with
whatever settings I have applied. However, when I fire a request to
the website, I get a "page can not be displayed" message". I get
nothing in the event viewer logs. I read somewhere that from website
properties Home Directory Application Settings, if I remove and
recreate the application pool, website starts serving requests. This
DOES work but I am unable to figure out how to accomplish this from my
code. When I checked Metabase.XML file of IIS before and after doing
this change manually, only change I noticed that following gets added
inside <IIsWebVirtualD ir>.

UNCPassword="49 634462500000000 600000040000000 bd77b5e56b3f000 048866b15ac840f 0bc531565bfc2a1 b5c6eb77c9661f5 27ba8edd7344f93 776e7cf6ae118bc db8db8a6ea143d7 ae1d03c8672ac2c 84bd677cd3fde3c 37cf6e6a0"

However, my app pool is running under "local system" identity. So this
string might correspond to some default encrypted string.

Does anyone know how to get it working from my code?

Thanks,
Mandar
Sep 9 '08 #1
4 3838
I don't know what the error is - however, running a web-site as "local
system" seems very, very dangerous... is there any good reason it
needs that level of power? "least priveleged", 'n all...

Marc
Sep 9 '08 #2
On Sep 9, 8:33*am, Mandar <mandarpkulka.. .@gmail.comwrot e:
Hi,

I have written some code in C# to programmaticall y create a website
and an application pool. Both seems to be getting created alright with
whatever settings I have applied. However, when I fire a request to
the website, I get a "page can not be displayed" message". I get
nothing in the event viewer logs. I read somewhere that from website
properties Home Directory Application Settings, if I remove and
recreate the application pool, website starts serving requests. This
DOES work but I am unable to figure out how to accomplish this from my
code. When I checked Metabase.XML file of IIS before and after doing
this change manually, only change I noticed that following gets added
inside <IIsWebVirtualD ir>.

UNCPassword="49 634462500000000 600000040000000 bd77b5e56b3f000 048866b15ac840f *0bc531565bfc2a 1b5c6eb77c9661f 527ba8edd7344f9 3776e7cf6ae118b cdb8db8a6ea143d 7*ae1d03c8672ac 2c84bd677cd3fde 3c37cf6e6a0"

However, my app pool is running under "local system" identity. So this
string might correspond to some default encrypted string.

Does anyone know how to get it working from my code?

Thanks,
Mandar
Most likely the "page can not be displayed" has error number... 500
being "Server Error" may contain additional information - the strings
IE displays under "Technical Information" on 500 errors. You could try
to reproduce the error inside IE.

Or it could be a 403

or even "page not found"
Sep 9 '08 #3
>>You could try to reproduce the error inside IE.

@G.S. - In IE I get the following -

<snip>
More information
This problem can be caused by a variety of issues, including:
Internet connectivity has been lost.
The website is temporarily unavailable.
The Domain Name Server (DNS) is not reachable.
The Domain Name Server (DNS) does not have a listing for the
website's
domain.
If this is an HTTPS (secure) address, click tools, click Internet
Options, click Advanced, and check to be sure the SSL and TLS
protocols are enabled under the security section.
</snip>
But I dont think any of this holds true for me.
>>running a web-site as "local system" seems very, very dangerous...

@Marc - I am writing an installer where I need to create a web site
and provide user with possible identity options as - Local System and
User Configurable. Thats not my issue here.

The fact that I can make the website working by just recreating the
application under the website leads me to believe that I have done
something wrong in my code or something is missing that should be
there. Any pointers?
Thanks,
Mandar
Sep 10 '08 #4
On Sep 10, 11:35*am, Mandar <mandarpkulka.. .@gmail.comwrot e:
>You could try to reproduce the error inside IE.

@G.S. - In IE I get the following -

<snip>
More information

This problem can be caused by a variety of issues, including:

Internet connectivity has been lost.
The website is temporarily unavailable.
The Domain Name Server (DNS) is not reachable.
The Domain Name Server (DNS) does not have a listing for the
website's
domain.
If this is an HTTPS (secure) address, click tools, click Internet
Options, click Advanced, and check to be sure the SSL and TLS
protocols are enabled under the security section.
</snip>

But I dont think any of this holds true for me.
>running a web-site as "local system" seems very, very dangerous...

@Marc - I am writing an installer where I need to create a web site
and provide user with possible identity options as - Local System and
User Configurable. Thats not my issue here.

The fact that I can make the website working by just recreating the
application under the website leads me to believe that I have done
something wrong in my code or something is missing that should be
there. Any pointers?

Thanks,
Mandar
Mandar, if the IE snipped is all you get, then that's probably HTTP
404 "Not found" response which may indicate that your request (URL)
was not correct or the server refused to serve it w/o providing
details. This was not the response I was expecting when permissions
are the issue, but I may be wrong.

I would definitely try to confirm the exact HTTP response code/error
you're getting back with that "Page Cannot be Displayed"

I would also try to make the website work as a stand-alone website
before going back and debugging from within your code.

Setting up IIS logging for that website may be helpful as well.
There's lots of resources on IIS logging - here's one you can start
with:
How to configure Web site logging in Windows Server 2003
http://support.microsoft.com/kb/324279
Sep 10 '08 #5

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

Similar topics

3
8378
by: Pattnayak | last post by:
Hi, I want to create a DTS package programatically (preferably in C#.net),which will copy all my tables from a oracle database to my sql-server database. Can anybody help me doing this??? Thanks Patnayak
6
13456
by: Null Reference | last post by:
Anybody here who can explain or point me to a link ? I wish to create a blank MS Access DB file programmatically using C# . Thanks, nfs
0
1321
by: MarkusPoehler | last post by:
I have several classic ASP projects running on Webserver. I would like to implement some .net functionalities. Because I need the references I have to "upgrade" the existing ones wit a new .net webproject. I've made some tests but it does not work. If I setup a new Webproject and define e.g. http://server1/web1 to store the project, it fails creating. Creating new projects into folders that don't exist also fails. Creating Web...
7
5325
by: coleenholley | last post by:
Hi all :-) I have a couple of web pages created using ASP.Net and VB code-behind. We use a connection call through an RPC to COBOL, NOT an SQL connection, so my connection to get the data is done in a Class Module (VB), which populates the datagrid. The datagrid is bound in the code-behind the ASPX page, as such dtg_worksheet1.DataSource = lo_AZRM005A.get_dt_worksheet dtg_worksheet1.DataBind( The code to populate my datagrid from the...
5
6500
by: Peter Schoots | last post by:
I am an amateur programmer and trying to move from VB6 to VB.net. I can't figure out how to create a ADO.NET database in code. I know how to create a dataset and wonder whether there is a way to "export" it into a new empty database. Since I am at it: How do you programmatically store a query into an ADO database? I am using ADOX to create an ADO database.
5
15330
by: Brian McClellan | last post by:
Just wondering if anyone has a simple example of creating a gridview completely programmatically, i'm not doing anything terribly sophisticated. When creating the gridview declaratively evertying works fine, however programmatically, while the grid will display data that exsists in the database, any operation on the data ( editing/updating/deleting ) seems to cause a rowdeleting/updating etc error. Or is this simply not meant to be done?
4
5466
by: VB Programmer | last post by:
My client wants to be able to have unlimited pages in his website and I'm making an "admin interface" for him to add and remove pages. (He will use Macromedia Contribute to modify the content of these new pages.) I would use straight HTML pages, but I need to use the "Master Page" for the aesthetics of the pages. I need the webapp to "recognize" these new aspx pages (or that an aspx page has been deleted.) Is it possible to...
6
2850
by: Mandar | last post by:
Hi, I have written some code in C# to programmatically create a website and an application pool. Both seems to be getting created alright with whatever settings I have applied. However, when I fire a request to the website, I get a "page can not be displayed" message". I get nothing in the event viewer logs. I read somewhere that from website properties Home Directory Application Settings, if I remove and recreate the application pool,...
2
3063
by: MalikTahirMahmood | last post by:
Hi, i am developing a car rental application, in which i required to get data from "salik Web site" UAE Toll system, I created one Desktop application in which i placed on webbrowser control and then programmatically login to the website and got all the required data, but since we need to collect data after every 15 mins so i want to create a windows service which can perform these tasks. So my question is How can i browse the website...
0
9449
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8186
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.