I am trying to deploy my ASP.NET 5 MVC project to a local IIS, but encountering some errors.
Error
When open (my website address) localhost:80 I have HTTP 404. I encounter the same behavior if I manually run approot\web.cmd . I think the problem is the same. In the web.cmd console web.cmd I see this output for each request (for non-static routes, static files work well):
fail: Microsoft.Data.Entity.Query.Internal.SqlServerQueryCompilationContextFactory[1] An exception occurred in the database while iterating the results of a query. System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. File not found. File name: 'System.Data.SqlClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Problem
When I start dnx web from the project development directory MySolution\src\MyProject Everything is OK
My project.json
You can see that I am using dnxcore50 and have no dependency on System.Data.SqlClient .
{ "userSecretsId": "aspnet5-Stomatology-b7dc4859-6376-4a5f-a583-d17b3660a64c", "version": "1.0.0-*", "compilationOptions": { "emitEntryPoint": true }, "dependencies": { "AutoMapper": "4.1.1", "Domain": "1.0.0-*", "EntityFramework.Commands": "7.0.0-rc1-final", "EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final", "Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-final", "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-rc1-final", "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final", "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final", "Microsoft.AspNet.Mvc": "6.0.0-rc1-final", "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final", "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final", "Microsoft.AspNet.Server.WebListener": "1.0.0-rc1-final", "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final", "Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final", "Microsoft.Extensions.CodeGenerators.Mvc": "1.0.0-rc1-final", "Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final", "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final", "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc1-final", "Microsoft.Extensions.Logging": "1.0.0-rc1-final", "Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final", "Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final", "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final" }, "commands": { "web": "Microsoft.AspNet.Server.Kestrel", "ef": "EntityFramework.Commands" }, "frameworks": { "dnxcore50": { } }, "exclude": [ "wwwroot", "node_modules" ], "publishExclude": [ "**.user", "**.vspscc" ], "scripts": { "prepublish": [ "npm install", "bower install" ] }
}
My Deployment and IIS Settings
- I use
File System options, for example, in manuals - I installed the HTTP platform handler
- I used an application pool without a management environment
Conclusion
So, is there a way to fix this problem?