Cannot document website

Dec 10, 2007 at 12:05 PM
I've set up the code in my web.config for documentation of my website but I'm getting the error "The given assembly name or codebase was invalid."

This is the code added to the web.config:
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" compilerOptions="/doc:C:\ProjectComments.xml" type="Microsoft.CSharp.CSharpCodeProvider, System, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</compilers>
</system.codedom>

Any ideas?

Thanks a lot
Coordinator
Dec 10, 2007 at 10:42 PM
From the help file:

The path after the "/doc:" option in the compilerOptions attribute should point to the .\bin folder under the website project's folder. If it does not exist, you may need to create the folder. Also note that the "Version" part of the type attribute may be different on your system. The example below was generated using .NET 2.0 but .NET 3.0 and .NET 3.5 may have a slightly different version number.

Eric
May 1, 2008 at 9:10 AM
Edited May 1, 2008 at 10:06 AM
Hi,
I get the same error. Mine is a .net 2.0 web site. I have added the following to web.config:

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.codedom>
<compilers>
<!-- For C# -->
<compiler language="c#;cs;csharp" extension=".cs"
compilerOptions="/doc:D:\Masters\PurchasingReportSoln\PurchasingReportWeb\Bin\MyProjectComments.xml"
type="Microsoft.CSharp.CSharpCodeProvider, System, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</compilers>
</system.codedom>
....................
</configuration>

The path after the "/doc:" option in the compilerOptions attribute DOES point to the .\bin folder under the website project's folder but i get the same error: The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

What must I do????

Thanks for your help...
Coordinator
May 1, 2008 at 3:05 PM
There's a bug in the given configuration setting that I didn't see in the help file until recently. Remove one "System, " from the type attribute. That should make it work.

However, the default code provider for C# doesn't produce XML comments files for each assembly anyway so it's not much use. I have written a custom code provider that can do that and can place the files in a folder of your choice. I'm going to post an article soon with the code providers. I'll see if I can get it done late today.

Note that the current version of SHFB isn't really set up to document website projects. In combination with the custom code providers, the next release will have better support for documenting them. It should be out in a week or two.

Eric