小编Hel*_*iac的帖子

命令行从TFS"获取最新"而不映射工作空间等

我假设这个:

tf.exe get $/project /recursive
Run Code Online (Sandbox Code Playgroud)

...需要这个奇怪的工作空间映射,已知的TFS服务器等.

有什么方法可以做这个最简单的事情:使用组凭据连接到这个 TFS服务器,获取项目的最新源代码并将其放在这里?全部来自命令行.

tfs automation

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

无法加载DLL'Microsoft.WITDataStore32.dll'(TeamFoundation.WorkItemTracking)

我发布这篇文章是希望能够节省别人花时间和精力来解决这个问题:

我目前的设置是VS2015TFS 2013.4

问题

我的旧PC设置有VS2013,我一直在使用Microsoft.TeamFoundation.WorkItemTracking.Client命名空间从TFS获取一些工作项信息.

我最近不得不重建我的电脑,并继续开发一个获取这些信息的程序.

令我沮丧的是,我一直收到一个错误:

Unable to load DLL 'Microsoft.WITDataStore32.dll'
Run Code Online (Sandbox Code Playgroud)

tfs-workitem tfs2013 vs-2015-preview

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

我应该在同一个项目中混合我的UnitTests和我的Integration测试吗?

我正在使用NUnit来测试我的C#代码,并且到目前为止已将单元测试(快速运行的)和集成测试(更长时间运行)分开,并且在单独的项目文件中.我使用NUnit进行单元测试和集成测试.我刚刚注意到NUnit提供的category属性,因此可以对测试进行分类.这引出了一个问题,我应该将它们混合在一起并简单地使用category属性来区分它们吗?

integration-testing nunit unit-testing

9
推荐指数
2
解决办法
786
查看次数

如何在继承的WinForm中向Container添加控件

我在另一个项目中有一个基本表单,它对所有WinForms程序强制执行相同的外观.我从BaseForm继承,创建自己的模板BaseView.我的这个模板有额外的控件,如ProgressBar,Timer和TableLayoutPanel.

我现在想继承我的BaseView并使用Designer添加我的程序特定控件,但是我不能删除任何类似Panel或任何其他控件的内容.我已经尝试了一些建议,比如确保基本表单的组件是公开的,但无济于事 - 大多数TLP的属性仍然是灰色的.

有人可能会给我任何建议吗?非常感谢!


partial class BaseView
{
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.IContainer components = null;

    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing)
    {
        if (disposing && (components != null))
        {
            components.Dispose();
        }
        base.Dispose(disposing);
    }

    #region Windows Form Designer generated code

    /// <summary>
    /// Required method for Designer support - do not modify
    /// …
Run Code Online (Sandbox Code Playgroud)

c# designer panel winforms

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

是否可以为yield-return 方法提供一个“finally”代码块?

背景

大家好。我有一个名为 it 的抽象类,BaseRecordFetcher<TEntity>它有一个方法,该方法从子类中获取 read/sort/translate/move-next 方法,并yield 将结果作为模型实体返回。

当我读取多个数据行时,它正确地yield return为每个实体执行 a 操作,然后在没有任何问题的情况下到达跟踪消息do...while

问题

然而我注意到,当我IEnumerable.FirstOrDefault()在集合上使用时,系统假设不需要更多的收益返回,并且它不会完成此方法的执行

除了返回多少记录的跟踪输出之外,我对这种行为没有太大问题,但它让我思考:“如果我确实需要一些......让我们称之为代码怎么办?finally

问题

有没有办法始终确保系统在之后运行一些后处理代码yield return

代码

/// <summary>
///     Retrieve translated entities from the database. The methods used to do
///     this are specified from the child class as parameters (i.e. Action or
///     Func delegates).
/// </summary>
/// <param name="loadSubsetFunc">
///     Specify how to load a set of database records. Return boolean
/// …
Run Code Online (Sandbox Code Playgroud)

c# ienumerable yield-return do-while

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

VS2012智能感知建议模式永久设置?

有没有办法让VS2012智能感知建议模式永久化,可能在TOOLS - >选项中设置它?或者可能通过在注册表中的某个位置设置它?

我非常喜欢这个概念,如果你知道IntelliSense不能自动完成你的新类名,它会让TDD变得更容易.但是,VS2012并不总是记住新解决方案/项目的此设置.

intellisense autocomplete visual-studio-2012

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

TDD - 为什么Assert.AreSame会通过?

我有一个测试方法......

[TestMethod]
public void MainViewModel_PropertiesReflectDataEntityProperties()
{
    // Arrange
    var facilityDataEntity = MockRepository.GenerateStub<FacilityDataEntity>();
    var shopOrderDataEntity = MockRepository.GenerateStub<ShopOrderDataEntity>();

    // Act
    MainViewModel mainViewModel = new MainViewModel(facilityDataEntity, shopOrderDataEntity);

    // Assert
    Assert.AreSame(facilityDataEntity.Value, mainViewModel.FacilityValue);
}
Run Code Online (Sandbox Code Playgroud)

......并且测试通过了.但是,我还没有实现DataEntity属性到MainViewModel属性的映射!怎么会这样?我以为AreSame会检查两个引用是否指向同一个实例.

public class MainViewModel
{
    private readonly FacilityDataEntity facilityDataEntity;
    private readonly ShopOrderDataEntity shopOrderDataEntity;

    public MainViewModel(FacilityDataEntity facilityDataEntity)
    {
        this.facilityDataEntity = facilityDataEntity;
    }

    public MainViewModel(FacilityDataEntity facilityDataEntity, ShopOrderDataEntity shopOrderDataEntity)
    {
        this.facilityDataEntity = facilityDataEntity;
        this.shopOrderDataEntity = shopOrderDataEntity;
    }

    public ShopOrderDataEntity ShopOrderDataEntity
    {
        get { return shopOrderDataEntity; }
    }

    public FacilityDataEntity FacilityDataEntity
    {
        get { return …
Run Code Online (Sandbox Code Playgroud)

c# tdd assert mstest

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

NuGet Package Manager窗口无法打开

使用Visual Studio 2015 RTM,每当我尝试重建我的应用程序时,NuGet Package Manager 3.0都会崩溃,这是在TFS源代码控制下.它也不会打开NuGet Package Manager配置窗口.

nuget visual-studio-2015

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

为什么Linq.Enumerable.Where打破了我的ObservableCollection

背景:

我正在编写一个WPF应用程序,严格遵循MVVM模式.我有一个BaseRepository类作为连接到不同数据库的通用接口(EF不是一个选项),一切正常; 这只是一个技术问题.

我使用一个名为NotifyingCollection的包装ObservableCollection来订阅IEditableObject的ItemEndEdit事件(我的ViewModelBase实体包装器实现了INotifyPropertyChanged和IEditableObject成员).

当在我的WPF DataGrid中编辑项目时调用ReadAll方法时,提供的代码示例将抛出" 'EditItem'不允许此视图 "异常.但是,如果我用注释掉的部分替换方法中的线,它就可以完美地工作!

题:

换句话说,它看起来像中继Linq.Enumerable.Where扩展方法而不是返回集合的IEnumerable版本从自定义集合中删除功能; 如果它们都是IEnumerable,为什么会这样呢?

代码示例:

namespace MyCompany.Common.Abstracts
{
    using System;
    using System.Collections.Generic;
    using System.Collections.Specialized;
    using System.ComponentModel;
    using System.Data.Common;
    using System.Diagnostics;
    using System.Linq;
    using System.Linq.Expressions;
    using MyCompany.Common.Extensions;
    using MyCompany.Common.Utilities;


    public abstract class BaseRepository<TEntity> : IDisposable where TEntity : ViewModelBase
    {
        protected BaseRepository()
        {
            this.EntitySet = new NotifyingCollection<TEntity>();
            this.EntitySet.ItemEndEdit += new ViewModelBase.ItemEndEditEventHandler(ItemEndEdit);
            this.EntitySet.CollectionChanged += new NotifyCollectionChangedEventHandler(CollectionChanged);
        }

        protected abstract NotifyingCollection<TEntity> EntitySet { get; set; }

        protected virtual void PropertyChanged(object sender, PropertyChangedEventArgs e)
        { …
Run Code Online (Sandbox Code Playgroud)

linq wpf ienumerable ieditableobject observablecollection

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