网站(vb.net)上的TagLib.Sharp(未定义类型'TagLib.File') [英] TagLib.Sharp on a website (vb.net) (Type 'TagLib.File' is not defined)

查看:103
本文介绍了网站(vb.net)上的TagLib.Sharp(未定义类型'TagLib.File')的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(VB.NET编码)

我正在使用TagLib-Sharp.我真的很喜欢它的运作方式.非常简单直接.好吧,无论如何,在VS中.

I am working with the TagLib-Sharp. I really enjoy how it works. Very simple and straight forward. Well, within VS, it is, anyway.

我拿走了文件并将它们放在我的Web服务器上,其中包括当我引用TagLib-Sharp.dll文件时VS用DLL文件创建的BIN文件夹.

I took the files and placed them on my web server, of which included the BIN folder that VS created with the DLL files when I referenced the TagLib-Sharp.dll file.

通过浏览器运行网站时,出现以下错误.

When I run the site through my browser, I get the following error.

Type 'TagLib.File' is not defined

有人告诉我我必须为其创建一个命名空间,所以我这样做了.我还包括了不同taglib的所有IMPORTS,但没有用.

I was told that I had to create a Namespace for it, so I did that. I also included all the IMPORTS for the different taglib's and that did not work.

这是我正在使用的代码.

Here is the code that I am working with.

default.aspx

default.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="TagLib._Default" %>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>

default.aspx.vb

default.aspx.vb

Imports TagLib
Imports TagLib.IFD
Imports TagLib.IFD.Tags
Imports TagLib.Xmp
Imports TagLib.Id3v2

Namespace TagLib
Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        Dim mp3 As TagLib.File = TagLib.File.Create("G:\InetPub\wwwroot\Media\m.mp3")
        Dim strAlbum As String = mp3.Tag.Album

        Label1.Text = "Album: " + strAlbum
        mp3.Dispose()
    End Sub

End Class
End Namespace

我还在系统中注册了DLL文件.

I also registered the DLL file with my system.

%windir%\microsoft.net\framework\v2.0.50727\regasm G:\WebFiles\taglib-sharp.dll /codebase

我还读到了有关此错误的信息,该错误涉及该文件所用的.NET版本以及该项目的用途.

I also read about this error, where it deals with the .NET version that was used for the file and what the project is made with.

我将.net的版本更改为2.5,然后更改为3.5,然后又更改为4.5,没关系.似乎没有任何作用.(除了很多错误,当我降至2.5时,这是一团糟)

I changed the version of .net down to 2.5 and then up to 3.5 and then back to 4.5 and it did not matter. Nothing seemed to work. (Other than a lot of errors when I went down to 2.5, it was a mess)

但是似乎没有任何效果.关于这个的任何想法都将是很棒的.多年来,我一直希望阅读mp3元数据,并将其添加到正在进行的项目中.我很接近,但似乎无法越过终点线.

But nothing seems to be working. Any idea's on this would be wonderful. Reading the mp3 metadata is something that I have been wanting to add to an ongoing project for many years. And I am this close, but cannot seem to cross that finish line.

在此烦人的问题上,谢谢您的一切帮助.

Thanks in advance for all assistance on this annoying issue.

CodingEE

推荐答案

好,对于遇到此问题的任何人.

OK, for anyone that runs into this issue.

这是解决问题的方法.

https://blogs.msdn.microsoft.com/tolong/2006/11/16/how-to-get-your-publickeytoken/

像魅力一样工作.我现在正在Web服务器上查看该站点.不错!!!!!

Works like a charm. I am now viewing the site on a web server. NICE!!!!!

CodingEE

这篇关于网站(vb.net)上的TagLib.Sharp(未定义类型'TagLib.File')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆