小编Mal*_*lil的帖子

什么是Global.asax ASP.Net Web API中的GlobalConfiguration.Configuration.EnsureInitialized()

在我的WebApi项目下,我不知道这行在 Global.asax方法中GlobalConfiguration.Configuration.EnsureInitialized()做了什么.如果没有这个,即使每件事都很好.那么为什么这样呢? Application_Start()

有必要来这儿吗?如果是,那为什么呢?任何人都可以详细解释其需要和目的.

protected void Application_Start()
{   
    AreaRegistration.RegisterAllAreas();
    FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
    RouteConfig.RegisterRoutes(RouteTable.Routes);

    ////////////      What is this for   ////////////////
    GlobalConfiguration.Configuration.EnsureInitialized();
}
Run Code Online (Sandbox Code Playgroud)

不是重复:堆栈溢出很多人建议使用EnsureInitialized().但为什么要使用它?它来自哪里?它是webApi2的一部分还是其他什么?这些是我想知道的事情.MSDN本身没有解释.

.net asp.net-mvc asp.net-mvc-4 asp.net-web-api asp.net-web-api2

7
推荐指数
1
解决办法
1602
查看次数

NodeJS - Javascript从String创建对象实例

在我的Node.Js应用程序(服务器端)中,我必须创建一个对象实例(这是一个类,所以有new MyClass()),但MyClass是一个string.

可以从String创建对象实例吗?我已经看到在浏览器方面我可以使用window,但在这里我在服务器端......

我将需要这个,因为我现在将在运行时使用该类的名称,因此我无法在"代码"中实例化此对象.

而且,我可以有几个需要以这种方式创建的类.简而言之,我有一个显式这种类的配置文件,我需要在真正的JavaScript对象中转换这个字符串.

javascript node.js

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

即使有正确的 cmd 和框架兼容版本也无法构建 sencha 应用程序

所有代码中都没有调试器。在本地一切都很好。但是一旦我开始构建应用程序,它就会显示以下错误。此外,在开发文件夹中一切正常。但是,当我尝试创建生产版本时,出现以下错误。

[ERR] BUILD FAILED
    [ERR] com.sencha.exceptions.ExNotFound: Failed to find mixin class: mymixin.language
    [ERR]
    [ERR] Total time: 6 seconds
    [ERR] The following error occurred while executing this 
    line:C:\TestApp\apps\myapp_dev\.sencha\app\build-impl.xml:367: The following error occurred while executing this line:C:\TestApp\apps\myapp_dev\.sencha\app\js-impl.xml:11: com.sencha.exceptions.ExNotFound: Failed to find mixin class: boseui.language9:35:39 PM"C:/Users/myaccount/bin/Sencha/Cmd/4.0.4.84/sencha" app refresh
Run Code Online (Sandbox Code Playgroud)

javascript extjs build sencha-cmd

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