Red Gate forums :: View topic - CommandLine Main:Unhandled Exception
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Doc 2
SQL Doc 2 forum

CommandLine Main:Unhandled Exception

Search in SQL Doc 2 forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
Yann Kahloun



Joined: 16 Feb 2012
Posts: 4

PostPosted: Thu Feb 16, 2012 12:53 pm    Post subject: CommandLine Main:Unhandled Exception Reply with quote

Hi,

We're having an issue with command line execution.
We're pretty sure the sqldoc extension file is ok, because, launching it within a .bat is working.

However using it within Cruise Control or Windows Task Planner for automation with the "System" account, produce an exception.

Stack (french) :
CommandLine
Main:Unhandled Exception
System.ArgumentNullException: La valeur ne peut pas être null.
Nom du paramètre : value
à System.IO.Directory.SetCurrentDirectory(String path)
à System.Environment.set_CurrentDirectory(String value)
à RedGate.SQLDoc.Engine.Project.Project.(String )
à RedGate.SQLDoc.Engine.Project.Project.set_FilePathOfHtml(String value)
à RedGate.SQLDoc.Engine.Project.Project..ctor()
à RedGate.SQLDoc.Engine.Project.Project.LoadFromDisk(String pathAndFileName)
à RedGate.SQLDoc.UI.CommandProcessor.RunProject()
à RedGate.SQLDoc.UI.CommandProcessor.Run()
à RedGate.SQLDoc.UI.Program.Main(String[] args)

Here is the conf part you probably want to see :
<?xml version="1.0" encoding="utf-8"?>
<Project Version="1" ApproxVals="0" DontUseDefaultCopyrightInfo="False" HtmlPath="D:\ContinuousIntegration\SqlDoc\Publish\" ProjectDescription="" Treeview="" OutputStyle="FramedHTML" Forced="False" NewDatabaseObjects="Enabled" IncludeSQLScript="True" IncludeTriggers="True" IncludeIndexes="True" IncludeFullIndexInfo="False" IncludeForiegnKeys="True" IncludeCheckConstraints="True" IncludePermissions="True" ThemeName="" ProjectName="nightly" AllowEditing="True" Server="XXX" Database="XXX" IntegratedSecurity="False" User="XXX" password="XXX">
<Items>
<Database Version="1" Server="XXX" Database="XXX" IntegratedSecurity="False" DirectoryName="XXX" User="XXX" password="XXX">
<Objects />
</Database>
</Items>
<OutputStyleOptions>
<StandardHTML>
<IncludeTimeStampInFileName value="False" />
</StandardHTML>
<FramedHTML />
<CompiledHelp>
<IncludeTimeStampInFileName value="False" />
</CompiledHelp>
<Word>
<IncludeTimeStampInFileName value="False" />
</Word>
</OutputStyleOptions>
<ObjectExclusions>
<ObjectExclusions />
</ObjectExclusions>
</Project>
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6677

PostPosted: Fri Feb 17, 2012 4:12 pm    Post subject: Reply with quote

Hi Yann,

I believe whatever utility that you use to launch SQL Doc needs to specify a working directory. When you launch from command prompt or from Windows, this is usually fed to the program's running environment automatically. But that doesn't mean to say CruiseControl or whatever will.
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1124
Location: Twitter: @dtabase

PostPosted: Fri Feb 17, 2012 5:37 pm    Post subject: Reply with quote

@Yann

Could you also post the command line and the parameters you are using?

David Atkinson
Red Gate
Back to top
View user's profile Send private message Send e-mail
Yann Kahloun



Joined: 16 Feb 2012
Posts: 4

PostPosted: Wed Jul 04, 2012 10:17 am    Post subject: Reply with quote

I'm sorry, i couldn't answer quickly.

@David
We're actually using the following command line :
sqldoc.exe" /project:"D:\ContinuousIntegration\SqlDoc\nightly.sqldoc"

@Brian
I guess I have to specify the working directory if i'm using SQLDoc via CruiseControl. Is there a specific parameter ?
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1124
Location: Twitter: @dtabase

PostPosted: Wed Jul 04, 2012 10:39 am    Post subject: Reply with quote

I would recommend you put the .sqldoc file in source control, so it is checked out automatically as part of your CI process. This means it can be invoked in relative terms.

You might want to try using the following switch to ensure the documentation output goes somewhere relative to the checkout folder.

/outputfolder:<outputfolder>

i.e., to put it in the current folder, and assuming you've put nightly.sqldoc in the root source control folder that is checked out by your CI process:

sqldoc.exe /project:nightly.sqldoc /outputfolder:.

Let me know if this fixes the problem.

David
Back to top
View user's profile Send private message Send e-mail
Yann Kahloun



Joined: 16 Feb 2012
Posts: 4

PostPosted: Wed Jul 04, 2012 1:10 pm    Post subject: Reply with quote

Hi,

We tried the "ouputfolder" tag already and CruiseControl's still failing.
Here's the other two things we tried :
1/ Automated task using Windows Task Planner :
Once we set an execution repository, the job is fine.
2/ Using CCNet, we tried to override the default execution repository but the issue is still the same.

Now, the issue seems to be more likely related to CCNet than to SqlDoc2.
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1124
Location: Twitter: @dtabase

PostPosted: Wed Jul 04, 2012 2:29 pm    Post subject: Reply with quote

Another thing worth trying is running the CruiseControl service with administrator privileges, as there is a known issue with SQL Doc which means it requires permissions to write temporary files to its installation folder. This is something we eventually plan to fix.

Does the sqldoc command line work when you run it from a command prompt?

David
Back to top
View user's profile Send private message Send e-mail
Yann Kahloun



Joined: 16 Feb 2012
Posts: 4

PostPosted: Wed Jul 04, 2012 2:40 pm    Post subject: Reply with quote

I tried to run it using simple command line and it worked.
Your last answer seems to be the way to solve my problem.

Considering I'm not the CruiseControl owner, I can't change the user it is running with. Anyway, we found a workaround (using Windows Task Planner). It is not perfect, but that will have to do.

Seems like we have to wait for that temp files issue you are talking about. Can you tell us more about it ?
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1124
Location: Twitter: @dtabase

PostPosted: Wed Jul 04, 2012 2:57 pm    Post subject: Reply with quote

All I can say is that the issue has internal ID SDOC-1481

I can't say when this will be fixed, but hopefully it won't be too long!
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group