david4chao
Programmer
When I want to try my first VS.Net web application, according to Microsoft SharePoint Services SDK, I need register micorsoft.sharepoint assembly. The following is my ASP.Net code:
<%@ Page language="c#" Codebehind="HelloWorld.aspx.cs" AutoEventWireup="false" Inherits="HelloWorld.HelloWorld" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
Assembly="Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>HelloWorld</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<SharePoint:FormDigest runat="server" ID="Formdigest1" NAME="Formdigest1" />
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 282px; POSITION: absolute; TOP: 282px" runat="server"
Text="Button"></asp:Button>
<asp:Label id="Label1" style="Z-INDEX: 102; LEFT: 192px; POSITION: absolute; TOP: 288px" runat="server">Label</asp:Label>
<asp:TextBox id="TextBox1" style="Z-INDEX: 103; LEFT: 384px; POSITION: absolute; TOP: 280px"
runat="server"></asp:TextBox>
</form>
</body>
</HTML>
An error popup:
Server Error in '/_layouts/HelloWorld' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: File or assembly name Microsoft.SharePoint, or one of its dependencies, was not found.
Source Error:
Line 1: <%@ Page language="c#" Codebehind="HelloWorld.aspx.cs" AutoEventWireup="false" Inherits="HelloWorld.HelloWorld" %>
Line 2: <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
Line 3: Assembly="Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral,
Line 4: PublicKeyToken=71e9bce111e9429c" %>
Source File: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\template\layouts\HelloWorld\HelloWorld.aspx Line: 2
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.SharePoint' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral
(Partial)
LOG: Appbase = file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/60/template/layouts/HelloWorld
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/_layouts_helloworld/a8b46169/d21c8426/Microsoft.SharePoint.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/_layouts_helloworld/a8b46169/d21c8426/Microsoft.SharePoint/Microsoft.SharePoint.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/60/template/layouts/HelloWorld/bin/Microsoft.SharePoint.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/60/template/layouts/HelloWorld/bin/Microsoft.SharePoint/Microsoft.SharePoint.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/_layouts_helloworld/a8b46169/d21c8426/Microsoft.SharePoint.EXE.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/_layouts_helloworld/a8b46169/d21c8426/Microsoft.SharePoint/Microsoft.SharePoint.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/60/template/layouts/HelloWorld/bin/Microsoft.SharePoint.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/60/template/layouts/HelloWorld/bin/Microsoft.SharePoint/Microsoft.SharePoint.EXE.
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Why?
Can anybody help me?
Thank you!
<%@ Page language="c#" Codebehind="HelloWorld.aspx.cs" AutoEventWireup="false" Inherits="HelloWorld.HelloWorld" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
Assembly="Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>HelloWorld</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<SharePoint:FormDigest runat="server" ID="Formdigest1" NAME="Formdigest1" />
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 282px; POSITION: absolute; TOP: 282px" runat="server"
Text="Button"></asp:Button>
<asp:Label id="Label1" style="Z-INDEX: 102; LEFT: 192px; POSITION: absolute; TOP: 288px" runat="server">Label</asp:Label>
<asp:TextBox id="TextBox1" style="Z-INDEX: 103; LEFT: 384px; POSITION: absolute; TOP: 280px"
runat="server"></asp:TextBox>
</form>
</body>
</HTML>
An error popup:
Server Error in '/_layouts/HelloWorld' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: File or assembly name Microsoft.SharePoint, or one of its dependencies, was not found.
Source Error:
Line 1: <%@ Page language="c#" Codebehind="HelloWorld.aspx.cs" AutoEventWireup="false" Inherits="HelloWorld.HelloWorld" %>
Line 2: <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
Line 3: Assembly="Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral,
Line 4: PublicKeyToken=71e9bce111e9429c" %>
Source File: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\template\layouts\HelloWorld\HelloWorld.aspx Line: 2
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.SharePoint' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral
(Partial)
LOG: Appbase = file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/60/template/layouts/HelloWorld
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/_layouts_helloworld/a8b46169/d21c8426/Microsoft.SharePoint.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/_layouts_helloworld/a8b46169/d21c8426/Microsoft.SharePoint/Microsoft.SharePoint.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/60/template/layouts/HelloWorld/bin/Microsoft.SharePoint.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/60/template/layouts/HelloWorld/bin/Microsoft.SharePoint/Microsoft.SharePoint.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/_layouts_helloworld/a8b46169/d21c8426/Microsoft.SharePoint.EXE.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/_layouts_helloworld/a8b46169/d21c8426/Microsoft.SharePoint/Microsoft.SharePoint.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/60/template/layouts/HelloWorld/bin/Microsoft.SharePoint.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/60/template/layouts/HelloWorld/bin/Microsoft.SharePoint/Microsoft.SharePoint.EXE.
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Why?
Can anybody help me?
Thank you!