小编Dar*_*one的帖子

allowDefinition ='MachineToApplication'错误设置<MvcBuildViews> true </ MvcBuildViews>

在我的Asp.Net MVC 4项目中,我已经在.csproj文件中设置了构建视图<MvcBuildViews>true</MvcBuildViews>.问题是构建项目我得到了错误:

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

我试图删除obj文件夹,但错误不断提高.该错误指定问题出在身份验证标记行中:

<system.web>
    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login" timeout="2880" />
    </authentication>
Run Code Online (Sandbox Code Playgroud)

通常,我能够通过运行应用程序(我收到错误)来运行应用程序,构建应用程序并在此之后再次运行.

msbuild asp.net-mvc visual-studio-2012

6
推荐指数
2
解决办法
1455
查看次数

Postgres GROUP BY 查看日期范围

我有一个表,其中包含“代码”值更改的历史记录。每个月此表都会获取一条新记录,其中包含指定月份的“代码”的新值。

+----------+------------+------------+------+
| Employee | FromDate   |  ToDate    | Code |
+----------+------------+------------+------+
| Employee | 01/07/2016 | 31/07/2016 |    4 |
| Employee | 01/06/2016 | 30/06/2016 |    2 |
| Employee | 01/05/2016 | 31/05/2016 |    2 |
| Employee | 01/04/2016 | 30/04/2016 |    3 |
| Employee | 01/03/2016 | 31/03/2016 |    3 |
| Employee | 01/02/2016 | 29/02/2016 |    4 |
| Employee | 01/01/2016 | 31/01/2016 |    4 |
+----------+------------+------------+------+
Run Code Online (Sandbox Code Playgroud)

我需要按此数据进行分组,以便每次“代码”更改时获取新记录,并获取“起始日期”的最小值和“截止日期”的最大值。数据必须按“FromDate”降序排列。通过我的查询,我得到了这个结果:

+----------+------------+------------+------+
| Employee …
Run Code Online (Sandbox Code Playgroud)

sql postgresql group-by gaps-and-islands

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

Angularjs $ injector:缩小后的run方法中的unpr

我在Angular应用程序上使用angular-xeditable.它在开发环境中工作正常,但在生产中,当所有js文件都缩小时,我收到此错误:

Uncaught Error: [$injector:strictdi] http://errors.angularjs.org/1.3.5/$injector/strictdi?p0=function(n)
Run Code Online (Sandbox Code Playgroud)

搜索我的代码,我发现xeditable出了问题.这里是coffescript中的应用创建代码:

# create the angular app
angular.module 'dbManagerApp', ['xeditable', 'ngDraggable']


# set the theme for the xeditable
.run (editableOptions, editableThemes) ->

    # set the default theme
    editableOptions.theme = 'default'

    # override the ok button
    editableThemes['default'].submitTpl = '<div class="small primary btn"><input type="submit" value="Ok" /></div>'

    # override the cancel button
    editableThemes['default'].cancelTpl = '<div class="small warning btn" ng-click="$form.$cancel()"><a href="#">Cancel</a></div>'
Run Code Online (Sandbox Code Playgroud)

这里是缩小版:

(function(){angular.module("dbManagerApp",["xeditable","ngDraggable"]).run(function(n,t){if(!_.isUndefined(n||_.isUndefined(n.theme)))return n.theme="default",t["default"].submitTpl='<div class="small primary btn"><input type="submit" value="Ok" /><\/div>',t["default"].cancelTpl='<div class="small warning btn" ng-click="$form.$cancel()"><a href="#">Cancel<\/a><\/div>'})}).call(this);
//# sourceMappingURL=DbManagerApp.min.js.map
Run Code Online (Sandbox Code Playgroud)

如果我在run方法中注释代码,它不会抛出异常.此方法用于配置文档中描述的xeditable …

javascript asp.net-mvc minify angularjs

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

npgsql 2.1.3和EF 6:无法确定存储版本; 需要有效的存储连接或版本提示

我正在为我的sql生成器添加对EF 6的支持,用于PostgreSQL:PostgreSQL Migration Generator

我已经创建了一个测试项目来尝试它,但是当我创建一个新连接时return new NpgsqlConnection();,它会向我抛出这个异常:

An exception of type 'System.NotSupportedException' occurred in EntityFramework.dll but was not handled in user code

Additional information: Unable to determine the provider name for provider factory of type 'Npgsql.NpgsqlFactory'. Make sure that the ADO.NET provider is installed or registered in the application config.
Run Code Online (Sandbox Code Playgroud)

按照Npgsql官方网站上的说明,我使用这个app.config文件:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections> …
Run Code Online (Sandbox Code Playgroud)

c# postgresql entity-framework npgsql

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