Francis Francis - 3 years ago 316
C# Question

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

I've upgraded my ASP.NET MVC Core project from 1.0 to 1.1 recently. I started to get some messages during the load process when I try to run the project in debug in 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.


I've tried reinstalling SQL Server 2012 and also SMO but to no avail.

Has anyone come across this before?

FYI, this is my project.json. All the references are working as far as I can tell.

{

"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%" ]
}
}

Answer Source

It turns out 1 of the upgraded assemblies has a dependency with the BatchParser assembly. Which one I'm not sure but I suspect it was 1 of the EF Core assemblies.

I was not able to obtain the Batchparser on its own, and the only source I was able to find it was via a new install of SQL Server 2017 express. Hope this helps someone.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download