我正在使用tfpt工具将货架从一个分支移动到另一个分支.我已经阅读了一些有关它的stackoverflow问题,但似乎都不适合我的问题.我正在运行这样的命令:
tfpt unshelve "my shelveset name" /migrate /source:source_brach /target:target_branch
Run Code Online (Sandbox Code Playgroud)
当我这样做时,我得到一个像这个例子的错误:
无法取消对filen_name_with_path的更改,因为服务器路径未映射到本地工作空间中
就像问题一样.我想检查异常集合上的某些内容是否是我的自定义异常,还是由.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)