.NET 4.0 support?

42 views
Skip to first unread message

Noldorin

unread,
Feb 1, 2010, 4:38:12 PM2/1/10
to docu
Hi there,

I have just encountered Docu for the time here, and from my first
impressions it seems like a great utility. I am already strongly
considering migrating over from MS Sandcastle, as Docu seems like a
much simpler, less bloated, and generally more effective tool.

The main thing stopping me at the moment, however, is the fact that it
does not (seem) to support .NET 4.0 beta. Are you planning support for
this in the future? If so, will this extend to the current beta
of .NET 4.0? I would be very keen to have this working for my ongoing
IRC.NET project <https://launchpad.net/ircdotnet>, so I would be
grateful to know. If you happen to be short on time/manpower, I would
even be willing to contribute to the source for this feature.

Thanks,
Alex

James Gregory

unread,
Feb 1, 2010, 4:41:36 PM2/1/10
to docu-...@googlegroups.com
Hi Alex,

I'm glad you like the look of Docu. I haven't had any specific thoughts on supporting the .Net 4 betas, though we would definitely support the final. Are there any specific problems you're encountering?

James


--
You received this message because you are subscribed to the Google Groups "docu" group.
To post to this group, send email to docu-...@googlegroups.com.
To unsubscribe from this group, send email to docu-group+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/docu-group?hl=en.


Noldorin

unread,
Feb 1, 2010, 4:46:05 PM2/1/10
to docu
Hi James,

That's good to hear. Indeed, it won't be long before the final release
of .NET 4.0 anyway, but being an impatient man, I'm keen to have
something for my next release.

Regarding the specific problem, I get the following response when I
run "docu IrcDotNet.dll". Perhaps I am jumping to conclusions here in
assuming it's a .NET 4.0 issue, but here it is anyway:

-------------------------------
docu: simple docs done simply
-------------------------------

Starting documentation generation
The requested file is in a bad format and could not be loaded:
'IrcDotNet.dll'

Generation complete

Note that I'm running docu from the latest trunk source.

Very impressed with the speed of your reply, by the way! :)

Alex

On Feb 1, 9:41 pm, James Gregory <jagregory....@gmail.com> wrote:
> Hi Alex,
>
> I'm glad you like the look of Docu. I haven't had any specific thoughts on
> supporting the .Net 4 betas, though we would definitely support the final.
> Are there any specific problems you're encountering?
>
> James
>

> On Mon, Feb 1, 2010 at 9:38 PM, Noldorin <alex...@gmail.com> wrote:
> > Hi there,
>
> > I have just encountered Docu for the time here, and from my first
> > impressions it seems like a great utility. I am already strongly
> > considering migrating over from MS Sandcastle, as Docu seems like a
> > much simpler, less bloated, and generally more effective tool.
>
> > The main thing stopping me at the moment, however, is the fact that it
> > does not (seem) to support .NET 4.0 beta. Are you planning support for
> > this in the future? If so, will this extend to the current beta
> > of .NET 4.0? I would be very keen to have this working for my ongoing
> > IRC.NET project <https://launchpad.net/ircdotnet>, so I would be
> > grateful to know. If you happen to be short on time/manpower, I would
> > even be willing to contribute to the source for this feature.
>
> > Thanks,
> > Alex
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "docu" group.
> > To post to this group, send email to docu-...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > docu-group+...@googlegroups.com<docu-group%2Bunsu...@googlegroups.com>

James Gregory

unread,
Feb 1, 2010, 4:54:02 PM2/1/10
to docu-...@googlegroups.com
Hmm, I've never seen that exception before (and neither has google, by the looks of things!).  It would be my guess that it's .Net 4 related. I assume you've compiled docu yourself using .Net 4?

To unsubscribe from this group, send email to docu-group+...@googlegroups.com.

Alex

unread,
Feb 1, 2010, 4:57:25 PM2/1/10
to docu-...@googlegroups.com
Actually, I compiled docu just using VS 2008 (in Release mode). The DLL
I'm running it on is however a .NET 4.0 assembly.

Alex

>> <docu-group%2Bunsu...@googlegroups.com<docu-group%252Buns...@googlegroups.com>

James Gregory

unread,
Feb 1, 2010, 4:58:49 PM2/1/10
to docu-...@googlegroups.com
Hmm, that might have something to do with it. Maybe a 3.5 assembly/executable can't parse a 4.0 assembly? I'd suggest trying recompiling docu as 4.0 and see if that has any effect.

To unsubscribe from this group, send email to docu-group+...@googlegroups.com.

Alex

unread,
Feb 1, 2010, 5:06:16 PM2/1/10
to docu-...@googlegroups.com
Ok, so I'm getting a bit further now with the .NET 4.0 compiled version.
The following error message is returned:

Unhandled Exception: Spark.Compiler.CompilerException: Dynamic view
compilation
failed.
(0,0): error CS1703: An assembly with the same identity 'mscorlib,
Version=4.0.0
.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' has already been
imported.
Try removing one of the duplicate references.
at Spark.Compiler.BatchCompiler.Compile(Boolean debug, String[]
sourceCode)
at
Spark.Compiler.CSharp.DefaultViewCompiler.CompileView(IEnumerable`1 viewTe
mplates, IEnumerable`1 allResources)
at Spark.SparkViewEngine.CreateEntry(Key key, Boolean compile)
at Spark.SparkViewEngine.CreateEntry(SparkViewDescriptor descriptor)
at Docu.Output.HtmlGenerator.Convert(String templateName, ViewData
data, Stri
ng relativeOutputPath) in
C:\Users\Alex\docu-.net4\src\Docu.Console\Output\HtmlG
enerator.cs:line 51
at Docu.Output.PageWriter.CreatePages(String templateDirectory,
String destin
ation, IList`1 namespaces) in
C:\Users\Alex\docu-.net4\src\Docu.Console\Output\P
ageWriter.cs:line 45
at Docu.Output.BulkPageWriter.CreatePagesFromDirectory(String
templatePath, S
tring destination, IList`1 namespaces) in
C:\Users\Alex\docu-.net4\src\Docu.Cons
ole\Output\BulkPageWriter.cs:line 25
at Docu.DocumentationGenerator.Generate() in
C:\Users\Alex\docu-.net4\src\Doc
u.Console\DocumentationGenerator.cs:line 93
at Docu.Console.ConsoleApplication.Run() in
C:\Users\Alex\docu-.net4\src\Docu
.Console\Console\ConsoleApplication.cs:line 97
at Docu.Console.ConsoleApplication.Run(IEnumerable`1 args) in
C:\Users\Alex\d
ocu-.net4\src\Docu.Console\Console\ConsoleApplication.cs:line 266
at Docu.Program.Main(String[] args) in
C:\Users\Alex\docu-.net4\src\Docu.Cons
ole\Program.cs:line 9

It's made me also wondier if there might be any chance of getting the
same docu program to target multiple versions of .NET. Something is
telling me it should be possible, although not in a straightforward way
most likely...

Alex

1 using Docu;
2 using Docu.TemplateExtensions;
3 using Docu.Parsing.Model;
4 using System.Linq;
5
6 [global::Spark.SparkViewAttribute(
7 Templates = new string[] {
8 "index.htm.spark"
9 })]
10 public class View6ab807d7fa8149e6a1aca416bb5ca63c :
Docu.Output.Rendering.Spa
rkTemplateBase
11 {
12
(many more lines...)

>>>> <docu-group%2Bunsu...@googlegroups.com<docu-group%252Buns...@googlegroups.com>
>> <docu-group%252Buns...@googlegroups.com<docu-group%25252Bun...@googlegroups.com>

James Gregory

unread,
Feb 1, 2010, 5:45:12 PM2/1/10
to docu-...@googlegroups.com
Now that exception I've seen before! Unfortunately, I'm not sure what you'll be able to do with it.

That exception is thrown because Spark loads all assemblies from the current AppDomain to use for generating the pages; this can cause errors when spark imports it's own assemblies and merges them with your own. I came up against this exception a couple of times in my testing project, but it's always been down to me loading assemblies I don't need; however, in this case I don't think it's avoidable. I guess the exception is being thrown because docu references the 4.0 mscorlib, while spark will references the 3.5 version.

So I guess the options are: rebuild the whole stack in 4.0, or patch spark to not load everything in the AppDomain. I have the change in Spark uncommitted, but I haven't put much thought into what assemblies to actually supply to Spark, so that's not so straight forward.

To unsubscribe from this group, send email to docu-group+...@googlegroups.com.

Alex

unread,
Feb 1, 2010, 6:26:52 PM2/1/10
to docu-...@googlegroups.com
Yeah, I'm sure your analysis is spot on here... Being able to tell Spark
which assemblies to load, as you say, may be the key to getting this to
work. It may also be the path to multi-targeting for docu. If you can
submit these changes you've made shortly, I would be happy to help
investigate a solution to running docu on .NET 4.0 assemblies.

Thanks,
Alex

>>>>>> <docu-group%2Bunsu...@googlegroups.com<docu-group%252Buns...@googlegroups.com>
>> <docu-group%252Buns...@googlegroups.com<docu-group%25252Bun...@googlegroups.com>
>>>
>>>> <docu-group%252Buns...@googlegroups.com<docu-group%25252Bun...@googlegroups.com>
>> <docu-group%25252Bun...@googlegroups.com<docu-group%2525252Bu...@googlegroups.com>

James Gregory

unread,
Feb 2, 2010, 12:52:30 PM2/2/10
to docu-...@googlegroups.com
I'll try to get a commit in tonight that'll include an updated Spark, but I still don't really know how to decide what assemblies to include. My first thought was to take the list of assemblies supplied for documenting, then recurse up their dependencies and use those as the list; however, I'm not sure if this would have the same end result as just loading everything in the AppDomain (and thus the same issue).

To unsubscribe from this group, send email to docu-group+...@googlegroups.com.

Alex

unread,
Feb 2, 2010, 1:00:01 PM2/2/10
to docu-...@googlegroups.com
Ok, great. I'll certainly take a look when you do make the commit. I
suspect that walking the dependency tree *will* actually solve the
problem as it's not making the assumption that the assemblies loaded in
the current AppDomain are appropiate for the DLL being documented. We'll
see soon, anyway...

>>>>>> <docu-group%252Buns...@googlegroups.com<docu-group%25252Bun...@googlegroups.com>
>> <docu-group%25252Bun...@googlegroups.com<docu-group%2525252Bu...@googlegroups.com>
>>>
>>>> <docu-group%25252Bun...@googlegroups.com<docu-group%2525252Bu...@googlegroups.com>
>> <docu-group%2525252Bu...@googlegroups.com<docu-group%252525252B...@googlegroups.com>

Alex

unread,
Feb 7, 2010, 8:09:21 AM2/7/10
to docu-...@googlegroups.com
Hi James,

Any news on this update for Spark? Looking at the git repo, it seems
nothing has been committed in a while. If you're still troubling over
how to implement it, I would be happy to take a closer look myself and
do some testing, provided I know exactly what the problem is.

On 02/02/2010 5:52 PM, James Gregory wrote:

James Gregory

unread,
Feb 8, 2010, 7:30:48 AM2/8/10
to docu-...@googlegroups.com
Nothing done yet unfortunately. Time is pretty short right now, but I'll try to get onto it as soon as possible.

To unsubscribe from this group, send email to docu-group+...@googlegroups.com.

Alex

unread,
Feb 24, 2010, 3:20:06 PM2/24/10
to docu-...@googlegroups.com

Hi James,

Any updates on docu? I've held off on realling using it seriously so
far, though I've managed to complete the XML documentation for my
library and its dependency projects now, so I'm getting quite keen to
generate some HTML for it now. :) Sorry to bug you about this again, as
I guess you are still pretty busy, but it would be great to hear any news.

Cheers,
Alex

>>>>>> <docu-group%25252Bun...@googlegroups.com<docu-group%2525252Bu...@googlegroups.com>
>> <docu-group%2525252Bu...@googlegroups.com<docu-group%252525252B...@googlegroups.com>
>>>
>>>> <docu-group%2525252Bu...@googlegroups.com<docu-group%252525252B...@googlegroups.com>
>> <docu-group%252525252B...@googlegroups.com<docu-group%25252525252...@googlegroups.com>

Reply all
Reply to author
Forward
0 new messages