小编shr*_*rds的帖子

是否可以更改EF Migrations"Migrations"文件夹的位置?

默认情况下,add-migration命令尝试在其中创建迁移.cs文件

  • 项目根
    • 迁移

我想将我的迁移以及其余的EF相关代码存储在我项目的\ Data文件夹中:

  • 项目根
    • 数据
      • 迁移

有了这个结构,当我执行时

PM> add-migration Migration1
Run Code Online (Sandbox Code Playgroud)

在NuGet控制台中,我收到以下错误:

    System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\MyProjectRoot\Migrations\201112171635110_Migration1.cs'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.StreamWriter.CreateFile(String path, Boolean append)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize) …

entity-framework-4 ef-migrations

41
推荐指数
2
解决办法
1万
查看次数

Internet Explorer 11替换了Authorization标头

什么会导致Internet Explorer替换HTTP标头

Authorization : Bearer <server-provided-token>

Authorization : Negotiate <some token>

在发出AJAX请求时?

细节

在Internet Explorer中,Authorization: Bearer ...Internet Explorer使用标头发送一些配置为包含标头的AJAX请求Authorization: Negotiate ....

例如,Fiddler显示三个请求中的前两个包含Authorization : Bearer...标题,而第三个请求突然包含Authorization : Negotiate...标题.前两个请求成功,第三个请求失败,因为无法正确验证请求.

所有请求都是使用相同的客户端代码构建的,并且是一个接一个地进行的(在一秒的范围内).我已经验证了Authorization标头Bearer在所有三种情况下都正确包含令牌,直到请求提供给浏览器为止.

另外,我在Chrome中看不到相同的行为; 它只发生在IE中.

要求1

GET http://localhost/myapp/api/User HTTP/1.1
Accept: application/json, text/plain, */*
Authorization: Bearer oEXS5IBu9huepzW6jfh-POMA18AUA8yWZsPfBPZuFf_JJxq-DKIt0JDyPXSiGpmV_cpT8FlL3D1DN-Tv5ZbT73MTuBOd5y75-bsx9fZvOeJgg04JcO0cUajdCH2h5QlMP8TNwgTpHg-TR9FxyPk3Kw6bQ6tQCOkOwIG_FmEJpP89yrOsoYJoCfrAoZ7M4PVcik9F9qtPgXmWwXB2eHDtkls44wITF_yM_rPm5C47OPCvMVTPz30KwoEPi6fHUcL3qHauP-v9uypv2e48TyPHUwLYmNFxyafMhBx4TkovnRcsdLHZiHmSjMq0V9a2Vw70
Referer: http://localhost/client/login.html
Accept-Language: en-US
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Host: localhost
DNT: 1
Connection: Keep-Alive

要求2

POST http://localhost/myapp/api/Permissions HTTP/1.1
Referer: …

internet-explorer asp.net-web-api angularjs owin

37
推荐指数
3
解决办法
1万
查看次数