我正在使用Visual Studio 2013更新4.我创建了一个默认的MVC5 ASP.NET Web应用程序,经过测试,运行,一切正常。我选择了个人帐户授权(默认),并且没有任何更改。
然后我尝试在同一台PC的IIS服务器上本地发布,但是我在连接数据库时遇到了问题。
我安装了SQL Server 2012 Express,从那以后,什么都没有了。 我得到的错误是(exactly as here):
Could not load file or assembly 'Microsoft.Owin, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
尝试通过安装2.1.0 nuget包解决问题似乎可以部分解决问题,因为稍后在应用程序运行中我收到有关webgrease的错误,但这里没有版本不匹配。
项目是否有可能从其他地方获取web.config?如何解决这个问题?我不想与owin 2.1.0一起运行,因为最新版本是3.0.1。为什么安装SQL后它不起作用?卸载SQL并重新安装Visual Studio无法解决问题。
这是web.config片段(不工作):
...
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.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="1.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
</assemblyBinding>
</runtime>
...
以下是来自具有Sql Server 2012 express的计算机的程序包日志(不工作:
PM> Get-Package
Id Version Description/Release Notes
-- ------- -------------------------
Antlr 3.4.1.9004 ANother Tool for Language Recognition, is a language tool that provides a framework for con...
bootstrap 3.0.0 Sleek, intuitive, and powerful front-end framework for faster and easier web development.
EntityFramework 6.1.1 Entity Framework is Microsoft's recommended data access technology for new applications.
jQuery 1.10.2 jQuery is a new kind of JavaScript Library....
jQuery.Validation 1.11.1 This jQuery plugin makes simple clientside form validation trivial, while offering lots of ...
Microsoft.AspNet.Identity.Core 2.1.0 Core interfaces for ASP.NET Identity.
Microsoft.AspNet.Identity.E... 2.1.0 ASP.NET Identity providers that use Entity Framework.
Microsoft.AspNet.Identity.Owin 2.1.0 Owin implementation for ASP.NET Identity.
Microsoft.AspNet.Mvc 5.2.2 This package contains the runtime assemblies for ASP.NET MVC. ASP.NET MVC gives you a power...
Microsoft.AspNet.Razor 3.2.2 This package contains the runtime assemblies for ASP.NET Web Pages. ASP.NET Web Pages and t...
Microsoft.AspNet.Web.Optimi... 1.1.3 ASP.NET Optimization introduces a way to bundle and optimize CSS and JavaScript files.
Microsoft.AspNet.WebPages 3.2.2 This package contains core runtime assemblies shared between ASP.NET MVC and ASP.NET Web Pa...
Microsoft.jQuery.Unobtrusiv... 3.2.2 jQuery plugin that unobtrusively sets up jQuery.Validation.
Microsoft.Owin 3.0.0 Provides a set of helper types and abstractions for simplifying the creation of OWIN compon...
Microsoft.Owin.Host.SystemWeb 3.0.0 OWIN server that enables OWIN-based applications to run on IIS using the ASP.NET request pi...
Microsoft.Owin.Security 3.0.0 Common types which are shared by the various authentication middleware components.
Microsoft.Owin.Security.Coo... 3.0.0 Middleware that enables an application to use cookie based authentication, similar to ASP.N...
Microsoft.Owin.Security.Fac... 3.0.0 Middleware that enables an application to support Facebook's OAuth 2.0 authentication workf...
Microsoft.Owin.Security.Google 3.0.0 Contains middlewares to support Google's OpenId and OAuth 2.0 authentication workflows.
Microsoft.Owin.Security.Mic... 3.0.0 Middleware that enables an application to support the Microsoft Account authentication work...
Microsoft.Owin.Security.OAuth 3.0.0 Middleware that enables an application to support any standard OAuth 2.0 authentication wor...
Microsoft.Owin.Security.Twi... 3.0.0 Middleware that enables an application to support Twitter's OAuth 2.0 authentication workflow.
Microsoft.Web.Infrastructure 1.0.0.0 This package contains the Microsoft.Web.Infrastructure assembly that lets you dynamically r...
Modernizr 2.6.2 Modernizr adds classes to the <html> element which allow you to target specific browser fun...
Newtonsoft.Json 6.0.4 Json.NET is a popular high-performance JSON framework for .NET
Owin 1.0 OWIN IAppBuilder startup interface
Respond 1.2.0 The goal of this script is to provide a fast and lightweight (3kb minified / 1kb gzipped) s...
WebGrease 1.5.2 Web Grease is a suite of tools for optimizing javascript, css files and images.
以下是来自不同SQL Server的其他计算机的程序包日志:
PM&GT;得到级封装
Id Version Description/Release Notes
-- ------- -------------------------
Antlr 3.4.1.9004 ANother Tool for Language Recognition, is a language tool that provides a framework for constr...
bootstrap 3.0.0 Sleek, intuitive, and powerful front-end framework for faster and easier web development.
EntityFramework 6.1.1 Entity Framework is Microsoft's recommended data access technology for new applications.
jQuery 1.10.2 jQuery is a new kind of JavaScript Library....
jQuery.Validation 1.11.1 This jQuery plugin makes simple clientside form validation trivial, while offering lots of opt...
Microsoft.AspNet.Identity.Core 2.1.0 Core interfaces for ASP.NET Identity.
Microsoft.AspNet.Identity.E... 2.1.0 ASP.NET Identity providers that use Entity Framework.
Microsoft.AspNet.Identity.Owin 2.1.0 Owin implementation for ASP.NET Identity.
Microsoft.AspNet.Mvc 5.2.2 This package contains the runtime assemblies for ASP.NET MVC. ASP.NET MVC gives you a powerful...
Microsoft.AspNet.Razor 3.2.2 This package contains the runtime assemblies for ASP.NET Web Pages. ASP.NET Web Pages and the ...
Microsoft.AspNet.Web.Optimi... 1.1.3 ASP.NET Optimization introduces a way to bundle and optimize CSS and JavaScript files.
Microsoft.AspNet.WebPages 3.2.2 This package contains core runtime assemblies shared between ASP.NET MVC and ASP.NET Web Pages.
Microsoft.jQuery.Unobtrusiv... 3.2.2 jQuery plugin that unobtrusively sets up jQuery.Validation.
Microsoft.Owin 3.0.0 Provides a set of helper types and abstractions for simplifying the creation of OWIN components.
Microsoft.Owin.Host.SystemWeb 3.0.0 OWIN server that enables OWIN-based applications to run on IIS using the ASP.NET request pipel...
Microsoft.Owin.Security 3.0.0 Common types which are shared by the various authentication middleware components.
Microsoft.Owin.Security.Coo... 3.0.0 Middleware that enables an application to use cookie based authentication, similar to ASP.NET'...
Microsoft.Owin.Security.Fac... 3.0.0 Middleware that enables an application to support Facebook's OAuth 2.0 authentication workflow.
Microsoft.Owin.Security.Google 3.0.0 Contains middlewares to support Google's OpenId and OAuth 2.0 authentication workflows.
Microsoft.Owin.Security.Mic... 3.0.0 Middleware that enables an application to support the Microsoft Account authentication workflow.
Microsoft.Owin.Security.OAuth 3.0.0 Middleware that enables an application to support any standard OAuth 2.0 authentication workflow.
Microsoft.Owin.Security.Twi... 3.0.0 Middleware that enables an application to support Twitter's OAuth 2.0 authentication workflow.
Microsoft.Web.Infrastructure 1.0.0.0 This package contains the Microsoft.Web.Infrastructure assembly that lets you dynamically regi...
Modernizr 2.6.2 Modernizr adds classes to the <html> element which allow you to target specific browser functi...
Newtonsoft.Json 6.0.4 Json.NET is a popular high-performance JSON framework for .NET
Owin 1.0 OWIN IAppBuilder startup interface
Respond 1.2.0 The goal of this script is to provide a fast and lightweight (3kb minified / 1kb gzipped) scri...
WebGrease 1.5.2 Web Grease is a suite of tools for optimizing javascript, css files and images.
答案 0 :(得分:0)
我之前遇到过这样的问题。正确的安装顺序是SQL Server 2012 THEN
Visual Studio 2013.
这是因为SQL Server已经使用一些Visual Studio组件构建,这些组件覆盖Visual Studio 2013组件导致不正确的行为/问题。
Visual Studio 2010,2008和SQL Server 2008也是如此.SQL Server应该始终是第一个。