Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 带特殊例外的循环依赖_C#_Asp.net_Xml_Asp.net Mvc 3_Exception - Fatal编程技术网

C# 带特殊例外的循环依赖

C# 带特殊例外的循环依赖,c#,asp.net,xml,asp.net-mvc-3,exception,C#,Asp.net,Xml,Asp.net Mvc 3,Exception,所以基本上我有循环依赖的问题--> 应用程序A->应用程序B。如果B中出现问题,则抛出A中捕获的异常,如果ex.message=“B中出现错误”,则再次在程序A中重新运行该函数 问题是现在我想抛出一个特殊异常。所以当它回到一个 try { x = (List<POSUnitRecord>)GalwayPortal.Download_POS(url, null, new XmlResultInterpreter()); } catch (XMLFailureException) { x

所以基本上我有循环依赖的问题-->

应用程序A->应用程序B。如果B中出现问题,则抛出A中捕获的异常,如果ex.message=“B中出现错误”,则再次在程序A中重新运行该函数

问题是现在我想抛出一个特殊异常。所以当它回到一个

try
{
x = (List<POSUnitRecord>)GalwayPortal.Download_POS(url, null, new XmlResultInterpreter());
}
catch (XMLFailureException)
{
x = (List<POSUnitRecord>)GalwayPortal.Download_POS(url, null, new XmlResultInterpreter());
}
试试看
{
x=(列表)GalwayPortal.Download_POS(url,null,新的XMLResultEnterpreter());
}
捕获(XMLFailureException)
{
x=(列表)GalwayPortal.Download_POS(url,null,新的XMLResultEnterpreter());
}

但是'XMLFailureExeption.cs'在应用程序A中。所以我尝试将这个类添加到B中。然后抛出
抛出新的XMLFailureExeption()错误,但它只是返回到a中的正常异常,在该异常中,它应该捕获该异常并重新运行该函数?请建议?

将XMLFailureException移动到a和B都引用的类库中。

在catch语句中重新尝试是非常可疑的。