2013-09-30 2 views
0

.aspx 웹 페이지에서 .dll 파일을 참조하려고합니다. 그러나 다음 오류가 발생합니다.'.dll'확장명으로 등록 된 빌드 공급자가 없습니다

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: There is no build provider registered for the extension '.dll'. You can register one in the <compilation><buildProviders> section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'. 

Source Error: 

Line 2: <%@ Page Title="" Language="C#" MasterPageFile="CSharpBPTestMaster.master" AutoEventWireup="true" CodeFile="CSharpBPTest.aspx.cs" Inherits="Button" Debug="true"%> 
Line 3: 
Line 4: <%@ Register tagprefix="blnc" tagname="Balanced" src="bin/Debug/BalancedTest.dll" %> 
Line 5: 
Line 6: 

Source File: /preview/1/balanced-csharp-master/src/BalancedTest/CSharpBPTest.aspx Line: 4 

내가 잘못하고있는 것이 확실하지 않습니다. .csproj 파일을 빌드합니다. 나는 bin\Debug\에 다음과 같은 한 :

  • Balanced.dll
  • Balanced.pdb
  • BalancedTest.dll
  • BalancedTest.pdb을
  • 여기

CSharpBPTest.aspx입니다 :

<%@ Page Title="" Language="C#" MasterPageFile="CSharpBPTestMaster.master" AutoEventWireup="true" CodeFile="CSharpBPTest.aspx.cs" Inherits="Button" Debug="true"%> 

<%@ Register tagprefix="blnc" tagname="Balanced" src="bin/Debug/BalancedTest.dll" %> 


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" 
    Runat="Server"> 
    <form id="form1" runat="server"> 
    <div> 


    <asp:Button ID="button1" runat="server" Text="Submit" OnClick="Button_Command"/> 

    <br /> 


    <br /> 
      <br><asp:label id="warningLabel" Text="" ForeColor="Red" runat="server"/><br> 
    <br /> 


    </div> 
    </form> 
</asp:Content> 

그리고 C# 파일에서 "가져 오기"(상단)과 같이 프로젝트 : 나는 내 C# 측이 컴파일 된 .dll 파일을 사용할 수 있도록하려면

using Balanced; 

. Balanced.dll은 외부 라이브러리입니다. 방금 파일과 .csproj 파일이 있습니다. 빌드를했는데 이제이 Balanced.dll 파일을 사용하려고합니다. 내가 놓친 게 있니? 이것이 나쁜 질문이라면 유감입니다. 나는 asp.net과 csproj에 익숙하다.

답변

0

당신은 그렇게 할 수 없습니다. src가 아닌 네임 스페이스를 지정해야합니다. src는 프로젝트 내의 usercontrols/servercontrols입니다.

네임 스페이스 값은 DLL 컴파일 방법과 네임 스페이스 구성에 따라 달라집니다.

또한이 경우 tagName을 지정하지 마십시오. tagName은 DLL 컨트롤의 클래스 이름입니다.

아주 기본적인 예는 다음과 같습니다 컴파일러 오류 메시지 : CS0246 :는 C#을 파일에 말한다 지금

<%-- assumes that 'BalancedTest' is the namespace that this control is in, and that the BalancedTest.dll already has a class that inherits UserControl (or a child of it) with the name 'BalancedTest'. --%> 
<%@ Register tagprefix="blnc" Namespace="BalancedTest" %> 
+0

'균형 잡힌'형식 또는 네임 스페이스 이름을 찾을 수 없습니다 (당신은 using 지시문 누락되거나 어셈블리 참조?) –

+0

DLL이 bin 폴더에 있어야합니다 (이미있는 것처럼 보입니다).하지만 프로젝트에 대한 참조도 추가해야합니다. 솔루션 탐색기에서 솔루션을 마우스 오른쪽 단추로 클릭하고 '참조 추가'를 선택하십시오. '찾아보기'를 클릭하고 프로젝트 파일 내의 dll을 검색하십시오. 추가를 클릭하거나 상자를 선택하여 참조를 포함시킵니다. 이 과정은 이전 Visual Studio와 2012 사이에서 약간 변경되었으므로 지원 버전을 알려 주거나 Google에 참조 추가 방법을 알려 주셔야합니다. – ps2goat

+0

사실 Visual Studio 대신 Web Expressions를 사용합니다. 그것은 똑같이 작동합니까? 외부 라이브러리 (다른 누군가가 작성한)와 함께 제공된 .csproj 파일을 사용하고 있습니다. (.cs, .aspx 및 .master) 3 개의 파일로 해당 라이브러리 (.dll 형식)를 사용하려고합니다. –