From: Benjamin W. <bw...@co...> - 2006-08-23 20:26:49
|
Hello: =20 I downloaded the NDOC source code (from http://jonas.lagerblad.com/blog/?p=3D4 <http://jonas.lagerblad.com/blog/?p=3D4> ), and added [STAThread] above the Main() method in ndocconsole. I tested the new executable and got the errors below----ndocconsole crashed at runtime. =20 There are other issues but if someone can help me figure out this one, I'd really appreciate it. =20 Thanks a lot. =20 Ben =20 ######################################################################## ################################## NAnt 0.85 (Build 0.85.2258.0; nightly; 3/8/2006) Copyright (C) 2001-2006 Gerry Shaw http://nant.sourceforge.net Buildfile: file:///C:/CoinData/products/microsoft/build.build <file:///C:\CoinData\products\microsoft\build.build>=20 Target framework: Microsoft .NET Framework 2.0 Target(s) specified: document=20 msdndocs: [delete] Deleting directory 'C:\CoinData\products\microsoft\docs_msdn'. [mkdir] Creating directory 'C:\CoinData\products\microsoft\docs_msdn'. [exec] Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'NDoc.Core, Version=3D1.3.2426.0, = Culture=3Dneutral, PublicKeyToken=3Db9896512f28c0f09' or one of its dependencies. The = located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) [exec] File name: 'NDoc.Core, Version=3D1.3.2426.0, = Culture=3Dneutral, PublicKeyToken=3Db9896512f28c0f09' [exec] at NDoc.ConsoleApplication.EntryPoint.Main(String[] args) [exec] WRN: Assembly binding logging is turned OFF. [exec] To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. [exec] Note: There is some performance penalty associated with assembly bind failure logging. [exec] To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. BUILD FAILED - 0 non-fatal error(s), 7 warning(s) C:\CoinData\products\microsoft\build.build(64,4): External Program Failed: ndocconsole.exe (return code was -532459699) Total time: 61.5 seconds. =20 =20 ________________________________ From: Gregory Williams [mailto:gre...@pu...]=20 Sent: Tuesday, August 22, 2006 7:08 PM To: Benjamin Wang Subject: RE: [Ndoc-users] NDoc Error: Anyone has a clue? =20 ________________________________ From: ndo...@li... [mailto:ndo...@li...] On Behalf Of Benjamin Wang Sent: 22 August 2006 15:17 To: ndo...@li... Cc: Allen Law Subject: [Ndoc-users] NDoc Error: Anyone has a clue?=20 [Snip]=20 [exec] Error: System.Threading.ThreadStateException [exec] ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment. [exec] at System.Windows.Forms.WebBrowserBase..ctor(String clsidString) [exec] at System.Windows.Forms.WebBrowser..ctor() [exec] at NDoc.Documenter.Msdn.MsdnUrlValidator.InitializeComponent() [exec] at NDoc.Documenter.Msdn.MsdnUrlValidator..ctor() [exec] at NDoc.Documenter.Msdn.MsdnDocumenter..ctor(MsdnDocumenterConfig config) [exec] at NDoc.Documenter.Msdn.MsdnDocumenterConfig.CreateDocumenter() [exec] at NDoc.ConsoleApplication.EntryPoint.Main(String[] args) [Snip] =20 It looks to me as if NDoc is being started on an MTA thread instead of an STA one. When it tries to create the instance of the web browser COM control it expects the thread to be STA, so complains when that isn't the case. =20 If you've got the source to NDocConsole handy then inserting: [STAThread] just above the Main() method, recompiling, and using this new version might do the trick. =20 Otherwise, have a try running the build task independent of NAnt. It's possible NDoc might be inheriting the MTA thread from that. =20 Gregory |