c#错误,Type没有被引用,但是它被引用了
本文关键字:引用 错误 Type | 更新日期: 2023-09-27 18:18:40
在我的项目(TestProject)中,我引用了来自另一个项目的DLL。该项目使用EntityFramework.Auditing。我在TestProject中有一个对EntityFramework的引用。审计和它的属性显示版本1.0.0.0,但得到这个错误:
类型为"EntityFramework.Auditing"。AuditDbContext'在未引用的程序集中定义。必须添加对程序集"EntityFramework"的引用。审计,版本=1.0.0.0,文化=中性,PublicKeyToken=null'.
更新:仔细看了一下,我看到了这个警告:
发现无法解决的同一从属程序集的不同版本之间的冲突。当日志详细度设置为详细时,这些引用冲突将在构建日志中列出。
我已经将输出和日志设置为详细,现在正在查看。我不知道我在找什么。
我在输出中看到:
在"EntityFramework。审计,版本=1.0.0.0,文化=中性,PublicKeyToken=a5fc4097df435221"answers"EntityFramework。审计,版本=1.0.0.0,文化=中性,PublicKeyToken=null".
"EntityFramework。审计,版本=1.0.0.0,文化=中性,PublicKeyToken=a5fc4097df435221"被选择,因为它是主要的和"EntityFramework"。审计,版本=1.0.0.0,文化=中性,PublicKeyToken=null"没有。
依赖"EntityFramework"的引用。审计,Version=1.0.0.0, Culture=neutral, PublicKeyToken=a5fc4097df435221" [C:'Users'mkenyon'Documents'Visual Studio 2013'Projects'IdentityMkp'IdentityMkp'bin' entityframework . audit .dll].
C:'Users'mkenyon'Documents'Visual Studio 2013'Projects'IdentityMkp'IdentityMkp'bin' entityframework . audit .dll
项目文件项包括导致引用"C:'Users'mkenyon'Documents'Visual Studio 2013'Projects'IdentityMkp'IdentityMkp'bin' entityframework . audit .dll"。
EntityFramework。审计,版本=1.0.0.0,文化=中性,PublicKeyToken=a5fc4097df435221, processorArchitecture=MSIL
依赖"EntityFramework"的引用。审计,Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" [C:'Projects'BitLocker'publicationsystem' publicationsystem . model 'bin'Debug' entityframework . audit .dll].
C: ' '磁盘加密' publicationsystem '项目PublicationSystem.Model ' bin '调试' PublicationSystem.Model.dll
项目文件项包括导致引用"C:'Projects'BitLocker'publicationsystem' publicationsystem . model 'bin'Debug' publicationsystem . model .dll".
PublicationSystem。模型
这是我的。csproj文件:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)'$(MSBuildToolsVersion)'Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)'$(MSBuildToolsVersion)'Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{817156B0-C54C-449B-B048-876C2C01A6BB}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>IdentityMkp</RootNamespace>
<AssemblyName>IdentityMkp</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin'</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin'</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..'packages'EntityFramework.6.1.3'lib'net45'EntityFramework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="EntityFramework.Auditing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a5fc4097df435221, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin'EntityFramework.Auditing.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..'packages'EntityFramework.6.1.3'lib'net45'EntityFramework.SqlServer.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="PublicationSystem.Model">
<HintPath>..'..'..'..'..'..'..'Projects'BitLocker'publicationsystem'PublicationSystem.Model'bin'Debug'PublicationSystem.Model.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.Routing" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..'packages'Microsoft.Web.Infrastructure.1.0.0.0'lib'net40'Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http">
</Reference>
<Reference Include="System.Net.Http.WebRequest">
</Reference>
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..'packages'Microsoft.AspNet.WebPages.3.2.2'lib'net45'System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="System.Web.Mvc, Version=__MvcPagesVersion__, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..'packages'Microsoft.AspNet.Mvc.5.2.2'lib'net45'System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Web.Optimization">
<HintPath>..'packages'Microsoft.AspNet.Web.Optimization.1.1.3'lib'net40'System.Web.Optimization.dll</HintPath>
</Reference>
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..'packages'Microsoft.AspNet.Razor.3.2.2'lib'net45'System.Web.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..'packages'Microsoft.AspNet.WebPages.3.2.2'lib'net45'System.Web.WebPages.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..'packages'Microsoft.AspNet.WebPages.3.2.2'lib'net45'System.Web.WebPages.Deployment.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..'packages'Microsoft.AspNet.WebPages.3.2.2'lib'net45'System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="WebGrease">
<Private>True</Private>
<HintPath>..'packages'WebGrease.1.5.2'lib'WebGrease.dll</HintPath>
</Reference>
<Reference Include="Antlr3.Runtime">
<Private>True</Private>
<HintPath>..'packages'Antlr.3.4.1.9004'lib'Antlr3.Runtime.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>..'packages'Newtonsoft.Json.6.0.4'lib'net45'Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNet.Identity.Core">
<HintPath>..'packages'Microsoft.AspNet.Identity.Core.2.1.0'lib'net45'Microsoft.AspNet.Identity.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNet.Identity.Owin">
<HintPath>..'packages'Microsoft.AspNet.Identity.Owin.2.1.0'lib'net45'Microsoft.AspNet.Identity.Owin.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNet.Identity.EntityFramework">
<HintPath>..'packages'Microsoft.AspNet.Identity.EntityFramework.2.1.0'lib'net45'Microsoft.AspNet.Identity.EntityFramework.dll</HintPath>
</Reference>
<Reference Include="Owin">
<HintPath>..'packages'Owin.1.0'lib'net40'Owin.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin">
<HintPath>..'packages'Microsoft.Owin.3.0.0'lib'net45'Microsoft.Owin.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Host.SystemWeb">
<HintPath>..'packages'Microsoft.Owin.Host.SystemWeb.3.0.0'lib'net45'Microsoft.Owin.Host.SystemWeb.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Security">
<HintPath>..'packages'Microsoft.Owin.Security.3.0.0'lib'net45'Microsoft.Owin.Security.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Security.Facebook">
<HintPath>..'packages'Microsoft.Owin.Security.Facebook.3.0.0'lib'net45'Microsoft.Owin.Security.Facebook.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Security.Cookies">
<HintPath>..'packages'Microsoft.Owin.Security.Cookies.3.0.0'lib'net45'Microsoft.Owin.Security.Cookies.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Security.OAuth">
<HintPath>..'packages'Microsoft.Owin.Security.OAuth.3.0.0'lib'net45'Microsoft.Owin.Security.OAuth.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Security.Google">
<HintPath>..'packages'Microsoft.Owin.Security.Google.3.0.0'lib'net45'Microsoft.Owin.Security.Google.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Security.Twitter">
<HintPath>..'packages'Microsoft.Owin.Security.Twitter.3.0.0'lib'net45'Microsoft.Owin.Security.Twitter.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Security.MicrosoftAccount">
<HintPath>..'packages'Microsoft.Owin.Security.MicrosoftAccount.3.0.0'lib'net45'Microsoft.Owin.Security.MicrosoftAccount.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="App_Start'BundleConfig.cs" />
<Compile Include="App_Start'FilterConfig.cs" />
<Compile Include="App_Start'IdentityConfig.cs" />
<Compile Include="App_Start'RouteConfig.cs" />
<Compile Include="App_Start'Startup.Auth.cs" />
<Compile Include="Controllers'AccountController.cs" />
<Compile Include="Controllers'HomeController.cs" />
<Compile Include="Controllers'ManageController.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Models'AccountViewModels.cs" />
<Compile Include="Models'IdentityModels.cs" />
<Compile Include="Models'ManageViewModels.cs" />
<Compile Include="Properties'AssemblyInfo.cs" />
<Compile Include="Startup.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Content'bootstrap.css" />
<Content Include="Content'bootstrap.min.css" />
<Content Include="favicon.ico" />
<Content Include="fonts'glyphicons-halflings-regular.svg" />
<Content Include="Global.asax" />
<Content Include="Content'Site.css" />
<Content Include="Scripts'bootstrap.js" />
<Content Include="Scripts'bootstrap.min.js" />
<None Include="Scripts'jquery-1.10.2.intellisense.js" />
<Content Include="Scripts'jquery-1.10.2.js" />
<Content Include="Scripts'jquery-1.10.2.min.js" />
<None Include="Scripts'jquery.validate-vsdoc.js" />
<Content Include="Scripts'jquery.validate.js" />
<Content Include="Scripts'jquery.validate.min.js" />
<Content Include="Scripts'jquery.validate.unobtrusive.js" />
<Content Include="Scripts'jquery.validate.unobtrusive.min.js" />
<Content Include="Scripts'modernizr-2.6.2.js" />
<Content Include="Scripts'respond.js" />
<Content Include="Scripts'respond.min.js" />
<Content Include="Scripts'_references.js" />
<Content Include="Web.config" />
<Content Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
<Content Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
<Content Include="Views'Web.config" />
<Content Include="Views'_ViewStart.cshtml" />
<Content Include="Views'Shared'Error.cshtml" />
<Content Include="Views'Shared'_Layout.cshtml" />
<Content Include="Views'Home'About.cshtml" />
<Content Include="Views'Home'Contact.cshtml" />
<Content Include="Views'Home'Index.cshtml" />
<Content Include="Scripts'jquery-1.10.2.min.map" />
<Content Include="Views'Account'_ExternalLoginsListPartial.cshtml" />
<Content Include="Views'Account'ConfirmEmail.cshtml" />
<Content Include="Views'Account'ExternalLoginConfirmation.cshtml" />
<Content Include="Views'Account'ExternalLoginFailure.cshtml" />
<Content Include="Views'Account'ForgotPassword.cshtml" />
<Content Include="Views'Account'ForgotPasswordConfirmation.cshtml" />
<Content Include="Views'Account'Login.cshtml" />
<Content Include="Views'Account'Register.cshtml" />
<Content Include="Views'Account'ResetPassword.cshtml" />
<Content Include="Views'Account'ResetPasswordConfirmation.cshtml" />
<Content Include="Views'Account'SendCode.cshtml" />
<Content Include="Views'Account'VerifyCode.cshtml" />
<Content Include="Views'Manage'AddPhoneNumber.cshtml" />
<Content Include="Views'Manage'ChangePassword.cshtml" />
<Content Include="Views'Manage'Index.cshtml" />
<Content Include="Views'Manage'ManageLogins.cshtml" />
<Content Include="Views'Manage'SetPassword.cshtml" />
<Content Include="Views'Manage'VerifyPhoneNumber.cshtml" />
<Content Include="Views'Shared'Lockout.cshtml" />
<Content Include="Views'Shared'_LoginPartial.cshtml" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data'" />
</ItemGroup>
<ItemGroup>
<Content Include="fonts'glyphicons-halflings-regular.woff" />
<Content Include="fonts'glyphicons-halflings-regular.ttf" />
<Content Include="fonts'glyphicons-halflings-regular.eot" />
<Content Include="packages.config" />
<None Include="Project_Readme.html" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)'Microsoft'VisualStudio'v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)'Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)'WebApplications'Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)'Microsoft'VisualStudio'v10.0'WebApplications'Microsoft.WebApplication.targets" Condition="false" />
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
</Target>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>15041</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:12454/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target> -->
</Project>
这是我的web.config:
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)'v11.0;AttachDbFilename=|DataDirectory|'aspnet-IdentityMkp-20151021040959.mdf;Initial Catalog=aspnet-IdentityMkp-20151021040959;Integrated Security=True" providerName="System.Data.SqlClient" />
<add name="MkpContext" connectionString="Data Source=192.168.1.16;Initial Catalog=Mkp;Persist Security Info=True;User ID=sa;Password=xxxxxxxx; MultipleActiveResultSets=true;Min Pool Size=20; Max Pool Size=200;Pooling=true;Connection Timeout=30" providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.webServer>
<modules>
<remove name="FormsAuthentication" />
</modules>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.2.0" newVersion="5.2.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
这是个愚蠢的用户错误。
entityframework . audit . auditdbcontext程序集是一个NuGet包,但是它也可以作为源代码下载。我正在使用来自另一个解决方案的程序集,并且没有记住我们在该解决方案中将源代码作为项目。
我需要指向我们在其他解决方案中构建的程序集,以便我使用的模型程序集能够理解审计程序集。