小编Max*_*uez的帖子

Mvc5,EF6,VisualStudio 2013中带有存储库的脚手架控制器

在vs2012中,我过去常常使用Steve Sanderson的mvcScaffolding Package和这个包,我可以使用单元测试和带有存储库和依赖注入的控制器来构建Action Methods.我的问题很简单.在vs2013中有没有办法这样做?当我在vs2013中安装软件包时,我收到以下错误:

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At C:\dev\WebApplication2\packages\T4Scaffolding.Core.1.0.0\tools\init.ps1:50 char:9
+         Set-DefaultScaffolder -Name CustomTemplate -Scaffolder T4Scaffolding.Cus ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At C:\dev\WebApplication2\packages\T4Scaffolding.Core.1.0.0\tools\init.ps1:51 char:9
+         Set-DefaultScaffolder -Name CustomScaffolder -Scaffolder T4Scaffolding.C ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At C:\dev\WebApplication2\packages\T4Scaffolding.1.0.8\tools\init.ps1:6 char:1
+ Set-DefaultScaffolder …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc-scaffolding t4scaffolding entity-framework-6 visual-studio-2013 asp.net-mvc-5

15
推荐指数
1
解决办法
7536
查看次数

Windows XP中Internet Explorer 8中的证书错误

我的队友和我正在研究的项目是在Windows XP上运行的Internet Explorer 8的安全问题.

我们的应用程序托管在Azure网站的专用实例中,并具有GeoTrust颁发的EV证书.证书在所有浏览器上都能正常运行,但在Windows XP上运行的Internet Explorer 8除外.我们收到以下警告:

The security certificate presented by this website was issued for a different website's address.

当我去查看证书时,我只看到*.azurewebsites.net的证书问题MSIT Machine Auth CS 2.

我们在之前的问题上找到了有关此问题的更多信息:IE8 SSL Cert问题,而其他浏览器就像魅力一样

解决方案是删除IIS上的SNI配置,但我们不能在azure网站上执行此操作.我们能做什么?

ssl windows-xp azure internet-explorer-8

6
推荐指数
1
解决办法
3573
查看次数

无法将实体框架核心加载到C#azure函数中

我已经开了一个问题,Azure/azure-functions-host和我有一个回购与再现步骤,但我在这里的情况下张贴这有什么内在的错误我在做什么,或者已经有人偶然打开这个问题.

我的目标:我想在一个azure函数中运行一些代码,这些代码存在于现有visual studio解决方案的类库中.

此代码恰好使用实体框架核心来读取和写入SQL Server数据库.

在尝试隔离我面临的问题时,我最终得到了以下场景:

Repro步骤:

  1. 在Visual Studio中:"文件">"新建">"项目">"Azure功能"

  2. 选择 Azure Functions v2 Preview (.NET Core)

  3. 选择 Http trigger

  4. 选择 Storage Emulator

  5. 选择访问权限 Function

  6. 使用nuget Microsoft.EntityFrameworkCore版本安装2.0.2

  7. EFCore包中添加对任何内容的调用

    在我的情况下,我添加了以下行:

    log.Info(typeof(DbContext).AssemblyQualifiedName);
    
    Run Code Online (Sandbox Code Playgroud)
  8. 确保azure存储模拟器正在运行

  9. 从visual studio(F5)运行该函数

  10. 点击控制台中打印的网址

预期的行为:以及示例Http trigger函数的默认行为,我希望看到每个调用打印以下行:

Microsoft.EntityFrameworkCore.DbContext, Microsoft.EntityFrameworkCore, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
Run Code Online (Sandbox Code Playgroud)

实际行为:应用程序在运行时抛出异常并输出以下内容

[11-Apr-18 6:33:59 AM]执行'Function1'(Reason ='此功能通过主机API以编程方式调用.',Id = 6faabfd8-eb96-4d71-906c-940028a7978a)
[11-Apr- 18 6:33:59 AM]执行'Function1'(失败,Id = 6faabfd8-eb96-4d71-906c-940028a7978a)
[11-Apr-18 6:33:59 AM] System.Private.CoreLib:执行函数时出现异常:Function1.FunctionApp1:无法加载文件或程序集"Microsoft.EntityFrameworkCore,Version = 2.0.2.0,Culture = neutral,PublicKeyToken = adb9793829ddae60".无法找到或加载特定文件.(来自HRESULT的异常:0x80131621).System.Private.CoreLib:无法加载文件或程序集'Microsoft.EntityFrameworkCore,Version …

c# azure entity-framework-core azure-functions

5
推荐指数
1
解决办法
881
查看次数