Robert Haken [MVP] napisal(a):
I try to build a simple web aplication in ASP.NET in Visual Studio 5.
When I run finished web aplication from inside VS5:
localhost:1675/test2/Default.aspx
everything is OK, works good.
But when I just navigate in my browser to:
localhost/test2/Default.aspx
i get Configuration Error:
Server Error in '/' Application.
Source Error:
Line 56: <authenticati on mode="Forms"/>
or sometimes:
Line 56: <authenticati on mode="Windows" />
(depends of my blind play with "ASP.NET Configuration")
I'm lame but I just want to made web aplication that may be available
to see
by other people on internet, not only by me :-) I don't want any
authentificatio n.
Help.
Well, you should provide full error description, not only this short
excerpt.
OK:
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as
allowDefinition ='MachineToAppl ication' beyond application level. This
error can be caused by a virtual directory not being configured as an
application in IIS.
Source Error:
Line 52: ASP.NET to identify an incoming user.
Line 53: -->
Line 54: <authenticati on mode="Windows" />
Line 55: <!--
Line 56: The <customErrorsse ction enables configuration
Source File: c:\inetpub\wwwr oot\test\web.co nfig Line: 54
Version Information: Microsoft .NET Framework Version:2.0.507 27.42;
ASP.NET Version:2.0.507 27.210
I guess you could have syntax error in web.config file (Parser error?).
If you have really simple application, you don't need the web.config file -
try to rename it to web.config.bak and try the application again.
But if I delete web.config I get other error:
Server Error in '/test' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.NullRefe renceException: Object reference not
set to an instance of an object.
Source Error:
The source code that generated this unhandled exception can only be
shown when compiled in debug mode. To enable this, please follow one of
the below steps, then request the URL:
1. Add a "Debug=true " directive at the top of the file that generated
the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your
application:
<configuratio n>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given
application to be compiled in debug mode. The first technique will
cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a
memory/performance overhead. You should make sure that an application
has debugging disabled before deploying into production scenario.
Stack Trace:
[NullReferenceEx ception: Object reference not set to an instance of an
object.]
DataSet1TableAd apters.RokUrodz eniaTableAdapte r.InitConnectio n() +58
DataSet1TableAd apters.RokUrodz eniaTableAdapte r.InitCommandCo llection()
+84
DataSet1TableAd apters.RokUrodz eniaTableAdapte r.GetYearBorn() +41
[TargetInvocatio nException: Exception has been thrown by the target of
an invocation.]
System.RuntimeM ethodHandle._In vokeMethodFast( Object target, Object[]
arguments, SignatureStruct & sig, MethodAttribute s methodAttribute s,
RuntimeTypeHand le typeOwner) +0
System.RuntimeM ethodHandle.Inv okeMethodFast(O bject target, Object[]
arguments, Signature sig, MethodAttribute s methodAttribute s,
RuntimeTypeHand le typeOwner) +72
System.Reflecti on.RuntimeMetho dInfo.Invoke(Ob ject obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture,
Boolean skipVisibilityC hecks) +296
System.Reflecti on.RuntimeMetho dInfo.Invoke(Ob ject obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+29
System.Web.UI.W ebControls.Obje ctDataSourceVie w.InvokeMethod( ObjectDataSourc eMethod
method, Boolean disposeInstance , Object& instance) +482
System.Web.UI.W ebControls.Obje ctDataSourceVie w.ExecuteSelect (DataSourceSele ctArguments
arguments) +1869
System.Web.UI.W ebControls.List Control.OnDataB inding(EventArg s e) +86
System.Web.UI.W ebControls.List Control.Perform Select() +18
System.Web.UI.W ebControls.Base DataBoundContro l.DataBind() +68
System.Web.UI.W ebControls.Base DataBoundContro l.EnsureDataBou nd() +61
System.Web.UI.W ebControls.List Control.OnPreRe nder(EventArgs e) +26
System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +88
System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +171
System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +171
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)
+5729
Version Information: Microsoft .NET Framework Version:2.0.507 27.42;
ASP.NET Version:2.0.507 27.210
What is wrong?