我在Asp.net应用程序上使用MySql.Data.dll
,当我从Visual Studio运行它时,我的应用程序在本地运行良好。但是当我在主机上发布它时,出现此错误
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.
Compiler Error Message: CS0246: The type or namespace name 'MySql' could not
be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 1: using MySql.Data.MySqlClient;
Line 2: using System;
Line 3: using System.Collections.Generic;
尽管我将这些文件保存在{Bin“文件夹MySql.Data.dll
BouncyCastle.Crypto.dll
Google.Protobuf.dll
中,然后在Web.Config文件中添加了这些行
<add assembly="MySql.Data, Version6.3.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
但我遇到另一个错误
Could not load file or assembly 'MySql.Data\, Version6.3.5.0\,
Culture\=neutral\, PublicKeyToken\=c5687fc88969c44d' or one of its
dependencies. The given assembly name or codebase was invalid. (Exception
from HRESULT: 0x80131047)
请帮助
笔记
*我正在使用.Net Framework 4.5.2
*我从NuGet安装了“ MySQL” 8.0.16
*我从PowerShell cmd获取MySQL版本和PublicKeyToken
请帮助