Monday, March 26, 2012

Object Reference not set

Hi

I am trying to compile an ASP.net project and I keep getting an error that says "Object Reference not set to an instance of an object" comming from the <Title> element

error:

Unable to start dbugging on the web server. <html>

<head>

<title>Object Reference not set to an instance of an object</title>

Source Code:

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<%
Page.Response.Write("My Web Page")

%>
</div>
</form>
</body>
</html>

try a semicolon after your code.

Page.Response.Write("My Web Page");


Hi,

C# statements must end with a semicolon.

Regards,

dg_pp


I fixed it I had to use

aspnet_regiis.exe -i

0 comments:

Post a Comment