繁体   English   中英

错误 4:无法加载文件或程序集 'MySql.Data.EntityFramework 或其依赖项之一。 定位的程序集的定义不匹配

[英]Error 4: Could not load file or assembly 'MySql.Data.EntityFramework or one of its dependencies. The located assembly's definition does not match

我不断收到错误消息“错误 4:无法加载文件或程序集‘MySql.Data.EntityFramework,Version=8.0.25.0,Culture=neutral,PublicKeyToken=c5687fc88969c44d’或其依赖项之一。找到的程序集的清单定义不匹配程序集引用。(HRESULT 异常:0x80131040)”在尝试编译我的 csproj 时。 任何帮助将不胜感激

这是我的 ucsdb.edmx

<?xml version="1.0" encoding="utf-8"?>

<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
<!-- EF Runtime content -->
<edmx:Runtime>
<!-- SSDL content -->
<edmx:StorageModels>
  <Schema Namespace="ucsdbModel.Store" Provider="MySql.Data.MySqlClient" 
ProviderManifestToken="5.6" Alias="Self"
          
xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator"
          xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
    <EntityType Name="Clan">
      <Key>
        <PropertyRef Name="ClanId" />
      </Key>
      <Property Name="ClanId" Type="bigint" Nullable="false" />
      <Property Name="LastUpdateTime" Type="datetime" Precision="0" Nullable="false" />
      <Property Name="Data" Type="text" Nullable="false" />
    </EntityType>
    <EntityType Name="Player">
      <Key>
        <PropertyRef Name="PlayerId" />
      </Key>
      <Property Name="PlayerId" Type="bigint" Nullable="false" />
      <Property Name="Avatar" Type="text" Nullable="false" />
      <Property Name="GameObjects" Type="text" Nullable="false" />
    </EntityType>
    <EntityContainer Name="ucsdbModelStoreContainer">
      <EntitySet Name="Clan" EntityType="Self.Clan" Schema="ucsdb" store:Type="Tables" />
      <EntitySet Name="Player" EntityType="Self.Player" Schema="ucsdb" store:Type="Tables" />
    </EntityContainer>
  </Schema>
</edmx:StorageModels>
<!-- CSDL content -->
<edmx:ConceptualModels>
  <Schema Namespace="ucsdbModel" Alias="Self" annotation:UseStrongSpatialTypes="false"
          xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation"
          xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
    <EntityType Name="Clan">
      <Key>
        <PropertyRef Name="ClanId" />
      </Key>
      <Property Name="ClanId" Type="Int64" Nullable="false" />
      <Property Name="LastUpdateTime" Type="DateTime" Nullable="false" />
      <Property Name="Data" Type="String" Nullable="false" MaxLength="65535" 
FixedLength="false" Unicode="false" />
    </EntityType>
    <EntityType Name="Player">
      <Key>
        <PropertyRef Name="PlayerId" />
      </Key>
      <Property Name="PlayerId" Type="Int64" Nullable="false" />
      <Property Name="Avatar" Type="String" Nullable="false" MaxLength="65535" 
FixedLength="false" Unicode="false" />
      <Property Name="GameObjects" Type="String" Nullable="false" MaxLength="65535" 
FixedLength="false"
                Unicode="false" />
    </EntityType>
    <EntityContainer Name="ucsdbEntities" annotation:LazyLoadingEnabled="true">
      <EntitySet Name="Clan" EntityType="Self.Clan" />
      <EntitySet Name="Player" EntityType="Self.Player" />
    </EntityContainer>
  </Schema>
</edmx:ConceptualModels>
<!-- C-S mapping content -->
<edmx:Mappings>
  <Mapping Space="C-S" 




xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs 
">
    <EntityContainerMapping 
StorageEntityContainer="ucsdbModelStoreContainer" 
CdmEntityContainer="ucsdbEntities">
      <EntitySetMapping Name="Clan">
        <EntityTypeMapping TypeName="ucsdbModel.Clan">
          <MappingFragment StoreEntitySet="Clan">
            <ScalarProperty Name="ClanId" 
ColumnName="ClanId" />
            <ScalarProperty Name="LastUpdateTime" 
ColumnName="LastUpdateTime" />
            <ScalarProperty Name="Data" 
ColumnName="Data" />
          </MappingFragment>
        </EntityTypeMapping>
      </EntitySetMapping>
      <EntitySetMapping Name="Player">
        <EntityTypeMapping 
TypeName="ucsdbModel.Player">
          <MappingFragment StoreEntitySet="Player">
            <ScalarProperty Name="PlayerId" 
ColumnName="PlayerId" />
            <ScalarProperty Name="GameObjects" 
ColumnName="GameObjects" />
            <ScalarProperty Name="Avatar" 
ColumnName="Avatar" />
          </MappingFragment>
        </EntityTypeMapping>
      </EntitySetMapping>
    </EntityContainerMapping>
  </Mapping>
</edmx:Mappings>
</edmx:Runtime>
<!-- EF Designer content (DO NOT EDIT MANUALLY BELOW 
HERE) -->
<Designer 
xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
<Connection>
  <DesignerInfoPropertySet>
    <DesignerProperty 
Name="MetadataArtifactProcessing" 
Value="EmbedInOutputAssembly" />
  </DesignerInfoPropertySet>
</Connection>
<Options>
  <DesignerInfoPropertySet>
    <DesignerProperty Name="ValidateOnBuild" 
Value="true" />
    <DesignerProperty Name="EnablePluralization" 
Value="false" />
    <DesignerProperty Name="IncludeForeignKeysInModel" 
Value="false" />
    <DesignerProperty Name="UseLegacyProvider" 
Value="false" />
    <DesignerProperty Name="CodeGenerationStrategy" 
Value="None" />
  </DesignerInfoPropertySet>
</Options>
<!-- Diagram content (shape and connector positions) - 
->
<Diagrams></Diagrams>
</Designer>
</edmx:Edmx>

需要使用MySql.Data.EntityFramework.8.0.25,但是程序没有这个dll文件或者使用其他版本。

单击项目的目录,右键单击 References 并打开 Manage NuGet Packages。 在此处输入图像描述

搜索 MySql.Data.EntityFramework 以查看版本。 我希望我能帮助你。 在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM