Corridor取其依赖的Alignment时,在我的用例下会稳定抛出异常AccessViolationException,请问我该如何规避或解决此问题,谢谢。

 ,我的代码片段

// 获得用户选择的路线
Bentley.CifNET.GeometryModel.RoadwayDesigner.Corridor rdCorridor =
	OrdObjectSpaceUtil.Active.GetObject<Bentley.CifNET.GeometryModel.RoadwayDesigner.Corridor>(element);

Console.WriteLine(rdCorridor.Name);

if (!(element.ElementType == (MSElementType) 106))
{
	MsNotificationUtil.OutputInfo("所选元素不是廊道对象");
	return;
}

// ConsensusConnection m_con = new ConsensusConnection(Bentley.MstnPlatformNET.Session.Instance.GetActiveDgnModelRef());
Corridor corridor = (element.ParentElement == null)
	? Corridor.CreateFromElement(m_con, element)
	: Corridor.CreateFromElement(m_con, element.ParentElement);
if (corridor == null)
{
	MsNotificationUtil.OutputInfo("所选元素不是廊道对象");
	return;
}

try
{
	Alignment corridorAlignment = corridor.CorridorAlignment; 		// 此处抛出AccessViolationException崩溃
}
catch (AccessViolationException ex)
{
	Trace.WriteLine(ex);
}
用例链接:pan.baidu.com/.../17uexIpAVfl-CFJSIW2u4GQ
提取码:49f3

提前谢过。