我正在一步一步地学习本教程
我在下面标记的行中遇到了一个例外
string url = "http://localhost:8080";
using (WebApp.Start(url)) //<------ error on this line
{
Console.WriteLine("Server running on {0}", url);
Console.ReadLine();
}
错误消息:
无法加载Microsoft的文件或程序集.奥温.安全性,版本=2.0.1.0,区域性=中性,PublicKeyToken=31bf3856ad364e35'或其依赖项之一.定位的程序集 list 定义与程序集引用不匹配.(HRESULT的例外:0x8013100)
更多信息:
在我的项目解决方案中,引用指向NuGet的packages文件夹中的dll
这已由NuGet添加到我的App.config文件中
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
在packages文件夹中,packages\Microsoft.Owin.Security.2.0.0\lib\net45
是Microsoft的文件版本.奥温.安全dll是2.020911.395