在 Visual Studio 2015 年加载 ASP.NET MVC 站点时获取 "Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=13.0.0.0"
Getting "Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=13.0.0.0" when loading ASP.NET MVC site on Visual Studio 2015
我最近将我的 ASP.NET MVC Core 项目从 1.0 升级到 1.1。当我在 Visual Studio 2015 中尝试 运行 调试中的项目时,我开始在加载过程中收到一些消息。
Could not load file or assembly 'Microsoft.SqlServer.BatchParser,
Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or
one of its dependencies. The system cannot find the file specified.
我已经尝试重新安装 SQL Server 2012 和 SMO,但无济于事。
以前有人遇到过这个吗?
仅供参考,这是我的 project.json。据我所知,所有参考资料都有效。
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.1.2",
"type": "platform"
},
"Microsoft.AspNetCore.Authentication.Cookies": "1.1.2",
"Microsoft.AspNetCore.Diagnostics": "1.1.2",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.2",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.2",
"Microsoft.AspNetCore.Mvc": "1.1.3",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.1.0-preview4-final",
"type": "build"
},
"Microsoft.AspNetCore.Routing": "1.1.2",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.2",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.2",
"Microsoft.AspNetCore.StaticFiles": "1.1.2",
"Microsoft.EntityFrameworkCore": "1.1.2",
"Microsoft.EntityFrameworkCore.Tools": "1.1.1",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.2",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.2",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.2",
"Microsoft.Extensions.Configuration.Json": "1.1.2",
"Microsoft.Extensions.Configuration.UserSecrets": "1.1.2",
"Microsoft.Extensions.Logging": "1.1.2",
"Microsoft.Extensions.Logging.Console": "1.1.2",
"Microsoft.Extensions.Logging.Debug": "1.1.2",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.2",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0",
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
"version": "1.1.1",
"type": "build"
},
"NLog.Web.AspNetCore": "4.3.0",
"NToastNotify": "1.0.6"
},
"tools": {
"BundlerMinifier.Core": "2.4.337",
"Microsoft.AspNetCore.Razor.Tools": "1.1.0-preview4-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final",
"Microsoft.EntityFrameworkCore.Tools": "1.1.1",
"Microsoft.Extensions.SecretManager.Tools": "1.0.1"
},
"frameworks": {
"netcoreapp1.1": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"**/*.cshtml",
"appsettings.json",
"web.config",
"nlog.config"
]
},
"scripts": {
"prepublish": [ "bower install", "dotnet bundle" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
原来有 1 个升级程序集与 BatchParser 程序集有依赖关系。我不确定是哪一个,但我怀疑它是 EF Core 程序集之一。
我无法自己获得 Batchparser,我唯一能找到它的来源是通过新安装的 SQL Server 2017 express。希望这对某人有所帮助。
我最近将我的 ASP.NET MVC Core 项目从 1.0 升级到 1.1。当我在 Visual Studio 2015 中尝试 运行 调试中的项目时,我开始在加载过程中收到一些消息。
Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
我已经尝试重新安装 SQL Server 2012 和 SMO,但无济于事。
以前有人遇到过这个吗?
仅供参考,这是我的 project.json。据我所知,所有参考资料都有效。
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.1.2",
"type": "platform"
},
"Microsoft.AspNetCore.Authentication.Cookies": "1.1.2",
"Microsoft.AspNetCore.Diagnostics": "1.1.2",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.2",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.2",
"Microsoft.AspNetCore.Mvc": "1.1.3",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.1.0-preview4-final",
"type": "build"
},
"Microsoft.AspNetCore.Routing": "1.1.2",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.2",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.2",
"Microsoft.AspNetCore.StaticFiles": "1.1.2",
"Microsoft.EntityFrameworkCore": "1.1.2",
"Microsoft.EntityFrameworkCore.Tools": "1.1.1",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.2",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.2",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.2",
"Microsoft.Extensions.Configuration.Json": "1.1.2",
"Microsoft.Extensions.Configuration.UserSecrets": "1.1.2",
"Microsoft.Extensions.Logging": "1.1.2",
"Microsoft.Extensions.Logging.Console": "1.1.2",
"Microsoft.Extensions.Logging.Debug": "1.1.2",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.2",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0",
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
"version": "1.1.1",
"type": "build"
},
"NLog.Web.AspNetCore": "4.3.0",
"NToastNotify": "1.0.6"
},
"tools": {
"BundlerMinifier.Core": "2.4.337",
"Microsoft.AspNetCore.Razor.Tools": "1.1.0-preview4-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final",
"Microsoft.EntityFrameworkCore.Tools": "1.1.1",
"Microsoft.Extensions.SecretManager.Tools": "1.0.1"
},
"frameworks": {
"netcoreapp1.1": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"**/*.cshtml",
"appsettings.json",
"web.config",
"nlog.config"
]
},
"scripts": {
"prepublish": [ "bower install", "dotnet bundle" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
原来有 1 个升级程序集与 BatchParser 程序集有依赖关系。我不确定是哪一个,但我怀疑它是 EF Core 程序集之一。
我无法自己获得 Batchparser,我唯一能找到它的来源是通过新安装的 SQL Server 2017 express。希望这对某人有所帮助。