小编Raf*_*ski的帖子

我无法取消从一个分支到另一个分支的变化

我正在使用tfpt工具将货架从一个分支移动到另一个分支.我已经阅读了一些有关它的stackoverflow问题,但似乎都不适合我的问题.我正在运行这样的命令:

tfpt unshelve "my shelveset name" /migrate /source:source_brach /target:target_branch
Run Code Online (Sandbox Code Playgroud)

当我这样做时,我得到一个像这个例子的错误:

无法取消对filen_name_with_path的更改,因为服务器路径未映射到本地工作空间中

tfs unshelve tfs2012

10
推荐指数
2
解决办法
3633
查看次数

如何检查某些内容是.net异常还是自定义异常

就像问题一样.我想检查异常集合上的某些内容是否是我的自定义异常,还是由.Net框架提供的Exception类.提前为您提供帮助.\

请注意:

我不知道我的自定义异常的类名是什么,它可以被称为exceptionA,exceptionB或者例如xyzException

我有这样的代码:

    public IEnumerable<Type> GetClassHierarchy(Type type)   
    {
        if (type == null) yield break;

        Type typeInHierarchy = type;

        do
        {
            yield return typeInHierarchy;
            typeInHierarchy = typeInHierarchy.BaseType;
        }
        while (typeInHierarchy != null && !typeInHierarchy.IsInterface);
    }

    public string GetException(System.Exception ex)
    {
        if (ex == null)
        {
            return null;
        }

        if (ex.InnerException == null)
        {
            return ex.Message;
        }

        var exceptionHerarchy = GetClassHierarchy(ex.GetType());


        var isMyException = exceptionHerarchy.Any(t => t != typeof(System.Exception));

        if (isMyException)
        {
            return string.Format("{0};{1}", ex.Message, GetException(ex.InnerException));
        }
        else
        {
            return GetException(ex.InnerException); …
Run Code Online (Sandbox Code Playgroud)

.net c# exception-handling exception

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

标签 统计

.net ×1

c# ×1

exception ×1

exception-handling ×1

tfs ×1

tfs2012 ×1

unshelve ×1