PDA

View Full Version : config problem


darktown
12-06-2004, 09:25 AM
configuration :
Window 2000 Server SP4
computer is Domain Controller

with asp.net webpages i get : unable to start debugging on web server access is denied.

I logged in as administrator, i am member of VS developers & debuggers

yet i get the problem, please can somebody help me?

I found a link of microsoft with : maybe you config file is not corrupt (not likely, cuz i tried with brand new webapp and still same error)

add verb 'debug' to isapi (it was already in it)

so i am hopeless

afterburn
12-06-2004, 12:34 PM
It might be the fact that its a domain controller.

You should not ever have a need to create a server that uses multiple roles on your network.

You might need to add administrators to the debug group.

Also why would you have VS installed on a domain controller, along with web services?

darktown
12-07-2004, 02:24 AM
I am following a course about linux & windows.
This contains that I have to work with windows (active directory , creating a domain controller learning stuff in general.) and sometimes i get bored here (because i already have seen most of the material)

That is why i installed VS.net here to relax and work on my website.


Administrators (is a built-in group) and built-in groups cannot be added to another group.

Administrator is memeber of Administrators
Administrator is also member of VS developping, debugging and so on..

I have just added the user 'administrator' to all the necessary groups but it doesn't work.

afterburn
12-07-2004, 09:59 AM
Your debugging on the server your working on also?

There might be more information on how to correct this issue on MSDN or Technet.

Font this on .net 247

solution given before was to change the ASPNET account to SYSTEM in machine.config. There are of course security implications


Its inherited from system to machine to applicaiton.

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/Q_20527591.html

darktown
12-13-2004, 05:18 AM
the redirection limit for this url has been exceeded. Unable to load the requested page. THis may be caused by cookies that are blocked...

Going to post all my code:
(i know you might have some problems with my way of writing code )

main.aspx :


<%@ Page Language="vb" AutoEventWireup="false" Codebehind="main.aspx.vb" Inherits="Darkanime.main"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--#include file='rightmenu.aspx'--> </TR></TABLE>




I really don't get it why it doesn't work.
On a win2k sp4 it works (no errors)
on a win2k server it doesn't work (get that annoying error)

I have done the stuff from the post above.. (re-registring iis ect..., no changes)

darktown
12-13-2004, 05:19 AM
menu class :


Public Class menu

Inherits System.Web.UI.Page
'declare a command and a reader
Dim scmd As New Odbc.OdbcCommand
Dim sdr As Odbc.OdbcDataReader
Dim query As String
'priority of menuitems
Dim prio As String
Dim rand As Random = New Random

Public Sub leftmenu()
Session("Hostname") = Environment.MachineName
Dim username As String = Session("Username")
Dim hostname As String = Session("Hostname")
Dim IP As String = HttpContext.Current.Request.UserHostAddress()
Session("IP") = IP

Session("random") = rand.Next(1, 6)

' connect to db
Try
myConnection.Open()
connOK = True
Catch er As System.Exception
Session("error") = "Error: " + Err.Description
HttpContext.Current.Response.Redirect("error.aspx")
End Try
' end connection



HttpContext.Current.Response.Write("<html><head><link href='../Styles.css' type='text/css' rel='stylesheet'></head><body MS_POSITIONING='GridLayout'>")
'banner
HttpContext.Current.Response.Write("<table width='780' cellspacing='0' cellpadding='0' align='center' >") 'border='1' bordercolor='#1258AE'
HttpContext.Current.Response.Write("<tr><td colspan='3'><img src='../images/banner.gif'></td></tr></table>")
'shortcuts menuItems
HttpContext.Current.Response.Write("<table bordercolor='#1258AE' width='780' height='100%' cellspacing='0' cellpadding='0' align='center' border='1' >")
HttpContext.Current.Response.Write("<tr height='20' class='main'>")
If Session("Username") <> "" Then
HttpContext.Current.Response.Write("<td width='120' class='small' align='left'><div class='taMenu'><ul><li><a href='logout.aspx'><span>Logout</span></a></li></ul></div></td>")

Else
HttpContext.Current.Response.Write("<td width='120' class='small' align='left'>&nbsp;</td>")
End If

HttpContext.Current.Response.Write("<td width='540' class='medium'>")

HttpContext.Current.Response.Write("<div class='taMenu'><ul><li><a href='main.aspx'><span>Home</span></a></li>")
If Session("Username") <> "" Then
HttpContext.Current.Response.Write("<li><a href='view.aspx?topic=galleries'><span>Galleries</span></a></li>")
Else
HttpContext.Current.Response.Write("<li><a href='login.aspx'><span>Login</span></a></li>")
End If
HttpContext.Current.Response.Write("<li><a href='search.aspx'><span>Search</span></a></li>")
HttpContext.Current.Response.Write("<li><a href='general.aspx?topic=contact'><span>Contact</span></a></li></lu>")

If Session("Username") <> "" Then
HttpContext.Current.Response.Write("Welcome :" & username & "</div></td> ")
Else
HttpContext.Current.Response.Write(hostname & "</div></td> ")
End If

HttpContext.Current.Response.Write("<td width='120' class='small' align='right'>IP :" & IP & "</td></tr>")
' end banner

'left menu start
HttpContext.Current.Response.Write("<tr class='main'><td width='120' align='left' valign='top'>")
'show menuheaders & menuitems
prio = Session("Priority")

query = "select * from tblmenuitem where Priority <='" & prio & "' order by ID"

If connOK = True Then
scmd.CommandText = query
scmd.Connection = myConnection
sdr = scmd.ExecuteReader()
HttpContext.Current.Response.Write("<table border='0' cellspacing='0' cellpadding='0'>")

While sdr.Read

Dim header As String = sdr.GetString(1)
If header <> Session("header") Then
HttpContext.Current.Response.Write("<tr><td height='26' class='Header'>" & sdr.GetString(1) & "</td></tr>")
End If
Session("header") = sdr.GetString(1)

HttpContext.Current.Response.Write("<tr><td width='120' class='menu'><a href='" & sdr.GetString(3) & "' >&nbsp;× " & sdr.GetString(2) & "</a></td></tr>")
End While
HttpContext.Current.Response.Write("</table>")
sdr.Close()
End If

HttpContext.Current.Response.Write("</td>") ' <!-- End Left Menu: -->

HttpContext.Current.Response.Write("<td class='main' valign='top' align='center' width='540'>") ' <!-- Main Start Here: -->
' page indicator
'''''''''''''''' END MENU '''''''''''''''''''
End Sub
End Class

darktown
12-13-2004, 05:22 AM
main.aspx.vb

Public Class main
Inherits System.Web.UI.Page
'declare a command and a reader
Dim scmd As New Odbc.OdbcCommand
Dim sdr As Odbc.OdbcDataReader
Dim query As String
Public rand2 As Random = New Random
Public rand3 As Int16 = rand2.Next(1, 5)
Dim counter As Int16
Dim tdclass As String
Dim objHash As New Hashtable
Dim objEntry As DictionaryEntry
Public popularusers As Array
Dim popuser As String
Public recentuser
'[region code]
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim leftmenu As New menu
leftmenu.leftmenu()

Response.Write("<table border='1' bordercolor='#1258AE' width='100%'>")
Response.Write("<tr><td class='medium'>Page : Main Page --> Newest Updates</td></tr></table>")

'get most popular users
query = "select Username from tblinlogdata order by hitcounter DESC LIMIT 0,5"
If connOK = True Then
scmd.CommandText = query
scmd.Connection = myConnection
sdr = scmd.ExecuteReader()
HttpContext.Current.Response.Write("<table border='0' cellspacing='0' cellpadding='0' width='100%'>")

While sdr.Read
popuser += sdr.GetString(0) & "/"
End While

sdr.Close()
popularusers = Split(popuser, "/")
Session("popuser1") = popularusers(0)
Session("popuser2") = popularusers(1)
Session("popuser3") = popularusers(2)
End If
'end most popular users

'get most recent user
query = "select Username from tblinlogdata order by Registration_Date DESC LIMIT 0,1;"
If connOK = True Then
scmd.CommandText = query
scmd.Connection = myConnection
sdr = scmd.ExecuteReader()
HttpContext.Current.Response.Write("<table border='0' cellspacing='0' cellpadding='0' width='100%'>")

While sdr.Read
Session("recentuser") = sdr.GetString(0)
End While

sdr.Close()
End If

'get number of messages in inbox
If Session("Priority") >= 2 Then
query = "select ID from tblmessages WHERE Destination ='" & Session("Username") & "'"
If connOK = True Then
scmd.CommandText = query
scmd.Connection = myConnection
sdr = scmd.ExecuteReader()
Session("inbox") = 0
While sdr.Read
Session("inbox") = Session("inbox") + 1
End While
sdr.Close()
End If
End If

'Fill Up Hashtable for Avatar
scmd.Connection = myConnection
scmd.CommandText = "SELECT Username, Avatar FROM tbluserinformation"
scmd.ExecuteNonQuery()
sdr = scmd.ExecuteReader()
While sdr.Read
objHash.Add(sdr.GetValue(0), sdr.GetValue(1))
End While
sdr.Close()

'update pagecounter
query = "select Hits from tblmenuitem WHERE Menuitem ='Main Page'"
If connOK = True Then
scmd.CommandText = query
scmd.Connection = myConnection
sdr = scmd.ExecuteReader()
Session("inbox") = 0
While sdr.Read
Session("hits") = sdr.GetValue(0)
End While
sdr.Close()
End If
Session("hits") = Session("hits") + 1
query = "update tblmenuitem SET Hits='" & Session("hits") & "'where menuitem='Main Page' "
scmd.CommandText = query
scmd.Connection = myConnection
scmd.ExecuteNonQuery()

'session info object
If Session("info") <> "" Then
Dim info As String = Session("info")
Response.Write("<table border='1' width='100%'><tr><td class='large'>" & info & "</td></tr></table>")
Session("info") = ""
End If

'new of Today
query = "select * from tblnews where Category ='Today'"
If connOK = True Then
scmd.CommandText = query
scmd.Connection = myConnection
sdr = scmd.ExecuteReader()
HttpContext.Current.Response.Write("<table border='0' cellspacing='0' cellpadding='0' width='100%'>")

While sdr.Read
For Each objEntry In objHash
If objEntry.Key = sdr.GetValue(4) Then
If objEntry.Value <> "" Then
Response.Write("<tr><td class='small1' width='25%'><img src='" & objEntry.Value & "'></td>")
Else
Response.Write("<tr><td class='small1' width='25%'><img src='../images/noavatar.jpg'></td>")
End If
End If
Next

Response.Write("<td class='small1'><u><b>" & sdr.GetString(2) & "</b></u><br/>" & sdr.GetString(3))

If Session("Priority") = 4 Then
Response.Write("<br/><a href='edit.aspx?topic=news&id=" & sdr.GetValue(0) & "'><img src='../images/icon_pencil.gif' height='10'></a>")
End If
Response.Write("</td>")
End While

sdr.Close()
Response.Write("</tr></table>")
End If
'end news of Today

'top 10 news post
query = "SELECT * FROM `tblnews` ORDER BY `Date` DESC LIMIT 0,10"
If connOK = True Then
scmd.CommandText = query
scmd.Connection = myConnection
sdr = scmd.ExecuteReader()
Response.Write("<br/><table cellspacing= '0' cellpadding='0' width='90%' border='1' bordercolor='#1258AE'>")
Response.Write("<tr><td class='large' colspan='3' align='center'><b>Latest 10 NewsPosts</b></td></tr>")
Response.Write("<tr><td><table width='100%'>")
Response.Write("<tr><th class='thsmall' width='8%'>Category</th><th class='thsmall'>Title</th><th class='thsmall' width='10%'>On:</th>")

If Session("Priority") = 4 Then
Response.Write("<th class='thsmall'>edit</th><th class='thsmall'>delete</th>")
End If
Response.Write("</tr>")

While sdr.Read
counter = counter + 1
If counter Mod 2 = 1 Then
tdclass = "small1c"
Else
tdclass = "small2c"
End If

Response.Write("<tr><td class='" & tdclass & "'>" & sdr.GetString(1) & "</td><td class='" & tdclass & "' align='center'><b><a href='view.aspx?topic=news&id=" & sdr.GetValue(0) & "'>" & sdr.GetString(2) & "</a></b></td><td class='" & tdclass & "'>" & sdr.GetValue(5) & "</td>")

If Session("Priority") = 4 Then
Response.Write("<td align='center' class='" & tdclass & "'><a href='edit.aspx?topic=news&id=" & sdr.GetValue(0) & "'><img src='../images/icon_pencil.gif' height='10'></a></td>")
Response.Write("<td align='center' class='" & tdclass & "'><a href='delete.aspx?topic=news&id=" & sdr.GetValue(0) & "'><img src='../images/icon_trashcan.gif'></a></td>")
End If
Response.Write("</tr>")
End While

sdr.Close()
Response.Write("</table></td></tr>")
Response.Write("</table>")
End If



End Sub
Private Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Unload
myConnection.Close()
End Sub
End Class

afterburn
12-13-2004, 10:42 AM
Why are you using include files inside of .net?

There is no real point in that. if you want a global look that is there then place in a web user control. If its code then place in a namespace/class, include the namespace by using statement, make functions static , constructor private and class sealed. This will help in the construction on modulations of parts of the application.


Place your code in a file. Then upload it.

darktown
12-13-2004, 12:21 PM
Thank you for all your tips, i'll make some changes and then upload my code.

It could take a while, thank you