小编And*_*nde的帖子

MsBuild不使用发布配置文件发布网站

一个发布配置文件发布了Visual Studio网站可以从两个在Visual Studio 2013中使用发布对话框,然后在命令行的MSBuild在这个问题解释使用的MSBuild执行文件系统发布配置文件

C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe 
./ProjectRoot/MyProject.csproj /p:DeployOnBuild=true /p:PublishProfile=FileSystemDebug
Run Code Online (Sandbox Code Playgroud)

但是,我想完全摆脱发布配置文件并从命令行执行所有操作 - 因为我不希望发布路径在PublishProfile xml文件中进行硬编码.如何直接在命令行参数中指定相同的选项?我已尝试使用OutDir,但这会导致与PublishProfile中指定的路径不同的行为(_PublishedWebsites附加到我的路径中).

msbuild continuous-integration

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

AngularJS强制验证或等待$ scope.myForm.$有效刷新

我更新了$scope我的Javascript,我想知道表单现在是否有效.如何强制进行验证或等待Angular运行验证?

这是一些示例代码.单击按钮时,$scope.validateA = true表单无效,但不会立即生效.所以在下一行代码中,如果我看一下$scope.abForm.$valid,它仍然是true.

var validationApp = angular.module('validationApp', []);

validationApp.controller('mainController', function($scope) {
  $scope.submitA = function() {
    $scope.validateA = true;
    //force validation to run here??
    alert($scope.abForm.$valid);
  };
});


<div ng-app="validationApp" ng-controller="mainController">
    <form name="abForm">
      a
      <input ng-required='validateA' ng-model='a'>
      <button type="button" ng-click="submitA()">submit a</button>
    </form>
</div>
Run Code Online (Sandbox Code Playgroud)

请参阅Plunker中的示例

angularjs angularjs-scope

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

具有基本类型的F#元组

是否可以一起使用元组和类层次结构?

我无法获得一个函数来接受一个抽象类型的元组参数:

[<AbstractClass>]
type XBase () = 
    member val Name="" with get, set 

type X () = 
    inherit XBase ()  

type Y () = 
    inherit XBase ()  

//fine without tuples
let f(values:seq<XBase>) =       
    printf "ok."

f [new X(); new Y()]

//this function won't work 
let f1<'V when 'V :> XBase>(keysAndValues:seq<'V * string>) =       
    printf "ok."

//compiler error: This expression was expected to have type X but here it has type Y
//f1 [(new X(), ""); (new Y(), "")]

System.Console.ReadLine()
Run Code Online (Sandbox Code Playgroud)

f#

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

Akka.Net 测试使用 TestKit 创建/监督子actor

我有类似于以下的 Akka.Net 代码,我正在尝试为它编写测试:

public class DoesSomethingActor : UntypedActor
{
    protected override void OnReceive(object message)
    {

    }
}

public class ForwardsMessagesActor : UntypedActor
{
    protected override void OnReceive(object message)
    {
        var actor = Context.ActorOf(Context.DI().Props<DoesSomethingActor>(), "DoesSomethingWorker");

        for (int i = 0; i < 5; i++)
        {
            actor.Tell(message + " " + i);
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

我已经让这个测试工作了,但我显然错过了一些东西,因为我根本没有使用太多的 TestKit。是否仍然没有关于如何使用 TestKit 进行测试的官方文档?

//creating actor mocks with Moq seems to confuse Akka - it just doesn't work 
//but creating mock classes manually like this, 
//then configuring …
Run Code Online (Sandbox Code Playgroud)

c# akka.net

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