我正在尝试从 .aspx 网页引用 .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\
:
- 平衡.dll
- 平衡的.pdb
- 平衡测试.dll
- 平衡测试.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# 文件中,我像这样“导入”项目(在顶部):
using Balanced;
我希望能够在我的 C# 端使用这个编译的 .dll 文件。Balanced.dll 是一个外部库。它只是附带文件和 .csproj 文件。我做了一个构建,现在我正在尝试使用这个 Balanced.dll 文件。我错过了什么吗?如果这是一个不好的问题,我很抱歉。我是 asp.net 和 csproj 的新手。