DinoMedlem sedan sep. 20011 914 inlägg Har komplierat en .vb fil och den hamnade där den skulle, men när jag skall köra .aspx filen så hittar den inte assemblyn. Någon som kan rada up vanliga fel om detta som man kan använda för att felsöka. Använde detta vid komplieringen
vbc /t:library /out:..\bin\CustomControld.dll /r:System.dll /r:System.Web.dll CustomControl.vb
behövs det mer eller skall detta räcka.
PaceMedlem sedan juni 20019 024 inlägg Visa lite kod och sökvägen till filen så ska vi nog kunna hjälpa dig.
renholmMedlem sedan apr. 20012 266 inlägg Plus fullständigt error meddelande.
DinoMedlem sedan sep. 20011 914 inlägg Detta är ett bokexemple och koden är som den är skriven i boken så enligt felmeddelandet så måste det ha något med sökvägen att göra.
Till .vb filen:
C:\Webbsidor\dot.net\books\aspnet3veckor\dag6\ovning02_02_CustomControl.vb
Till .dll filen:
C:\Webbsidor\dot.net\books\aspnet3veckor\bin\CustomControls.dll
Till .aspx filen:
C:\Webbsidor\dot.net\books\aspnet3veckor\dag6\ovning02_01_CustomControl.aspx
Felmeddelandet:
Server Error in '/dot.net' 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 CustomControls, or one of its dependencies, was not found.
Source Error:
Line 1: <%@ Page Language="VB" Trace="True" Debug="True" %>
Line 2: <%@ Register TagPrefix="ACME" Namespace="MyCustomControls" Assembly="CustomControls" %>
Line 3: <script runat="server">
Line 4:
Source File: C:\Webbsidor\dot.net\books\aspnet3veckor\dag6\ovning02_01_CustomControl.aspx Line: 2
Assembly Load Trace: The following information can be helpful to determine why the assembly 'CustomControls' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = CustomControls
(Partial)
LOG: Appbase = file:///C:/Webbsidor/dot.net
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: CustomControls
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files/dot.net/cac529e3/7a7bdeea/CustomControls.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files/dot.net/cac529e3/7a7bdeea/CustomControls/CustomControls.DLL.
LOG: Attempting download of new URL file:///C:/Webbsidor/dot.net/bin/CustomControls.DLL.
LOG: Attempting download of new URL file:///C:/Webbsidor/dot.net/bin/CustomControls/CustomControls.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files/dot.net/cac529e3/7a7bdeea/CustomControls.EXE.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files/dot.net/cac529e3/7a7bdeea/CustomControls/CustomControls.EXE.
LOG: Attempting download of new URL file:///C:/Webbsidor/dot.net/bin/CustomControls.EXE.
LOG: Attempting download of new URL file:///C:/Webbsidor/dot.net/bin/CustomControls/CustomControls.EXE.
PatrikBMedlem sedan mars 20002 836 inlägg har du lagt in den i web.config?
web.config
<configuration>
<system.web>
<customErrors mode="Off"/>
<compilation>
[b]<assemblies>
<add assembly="myCustomControl" />
</assemblies>[/b]
</compilation>
</system.web>
</configuration>
cya,
PatrikB
DinoMedlem sedan sep. 20011 914 inlägg Gjorde som ovan, men den klagar hela tiden på sökvägen. Får kolla mera imorgon.
Parser Error Message: File or assembly name CustomControls, or one of its dependencies, was not found.
renholmMedlem sedan apr. 20012 266 inlägg
LOG: Attempting download of new URL file:///C:/Webbsidor/dot.net/bin/CustomControls.DLL.
LOG: Attempting download of new URL file:///C:/Webbsidor/dot.net/bin/CustomControls/CustomControls.DLL.
Du har inte lagt din .dll fil i rätt bin mapp. Enligt loggen ovan letar den i \dot.net\bin där den ska ligga, din ligger i en undermapp till \dot.net testa att placera filen direkt i dot.net\bin och inte i C:\Webbsidor\dot.net\books\aspnet3veckor\bin\ eftersom dot.net troligtvis är din root katalog för applikationen.
DinoMedlem sedan sep. 20011 914 inlägg Nu funkar det. Tack för hjälpen. Det var som du skrev renholm, den låg i fel mapp. En fråga till, bin mappen kan endast ligga i rotmappen eller?
renholmMedlem sedan apr. 20012 266 inlägg Ja, om man inte på något sätt kan lägga in en alternativ bin mapp.