Тема: Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Xrecord): DisposableWrapper
Пробую сделать простейшую вещь: Открыть и закрыть файл
Остальное все закомментил
DocumentCollection acadDocMgr = Application.DocumentManager; var templateFile = new FileInfo(templateFilename); var outputFile = new FileInfo(outputFilename); File.Copy(templateFile.FullName, outputFile.FullName, true); Document doc = acadDocMgr.Open(outputFile.FullName, false); // doc.LockDocument(); // var db = doc.Database; doc.CloseAndSave(outputFilename); //doc.Database.SaveAs(doc.Name, DwgVersion.Current); doc.Dispose();
Ничегошеньки не редактирую
И с последним Dispose() и без него получаю при дебаге в консоли следующее
The thread 0x3028 has exited with code 0 (0x0).
The thread 0x1430 has exited with code 0 (0x0).
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2018\AcTcMgd.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2018\AcLayerTools.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.WindowsRuntime\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.WindowsRuntime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\system32\WinMetadata\Windows.ApplicationModel.winmd'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\system32\WinMetadata\Windows.Perception.winmd'. Module was built without symbols.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Numerics.Vectors\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Numerics.Vectors.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\system32\WinMetadata\Windows.Graphics.winmd'. Module was built without symbols.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2018\Autodesk.AutoCAD.Interop.dll'. Module was built without symbols.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Xrecord): DisposableWrapper
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Xrecord): DisposableWrapper
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Xrecord): DisposableWrapper
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Xrecord): DisposableWrapper
.............................Тут очень много таких строк..........................
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Xrecord): DisposableWrapper
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Xrecord): DisposableWrapper
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Xrecord): DisposableWrapper
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.TextStyleTableRecord): DisposableWrapper
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Xrecord): DisposableWrapper
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Xrecord): DisposableWrapper
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.TextStyleTableRecord): DisposableWrapper
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Xrecord): DisposableWrapper
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Xrecord): DisposableWrapper
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Xrecord): DisposableWrapper
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Xrecord): DisposableWrapper
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Xrecord): DisposableWrapper
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.TextStyleTableRecord): DisposableWrapper
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Xrecord): DisposableWrapper
The thread 0x4eec has exited with code 0 (0x0).
The thread 0x2b5c has exited with code 0 (0x0).
The thread 0x5438 has exited with code 0 (0x0).
Что я делаю не так??? :o