I am trying to use NDoc on a project that I upgraded from Visual Studio 2008 to 2010. Everything worked find on 2008, but with 2010, I get:
Could not load file or assembly 'c:\tools\cruisecontrol\projects\cs-encog-core\stage\src\encog-core-cs\bin\release\encog-core-cs.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Exception: NDoc3.Core.DocumenterException
Could not load file or assembly 'c:\tools\cruisecontrol\projects\cs-encog-core\stage\src\encog-core-cs\bin\release\encog-core-cs.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Exception: System.BadImageFormatException
Could not load file or assembly 'c:\tools\cruisecontrol\projects\cs-encog-core\stage\src\encog-core-cs\bin\release\encog-core-cs.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Same here.
It looks like a test was done on "recompiling a .net 3.5 app with VS2010", which would work, as the framework is the same.
However, the latest published beta only permits frameworks up to 3.5 to be selected, and was most likely compiled against the 3.5 framework, so: It is not able to "reflect" into the .net 4.0 code.
If the sources are recompiled against framework 4, and framework 4 is added to the list in configuration, this may go a long way to addressing this.
There is clearly other work (needed or in progress) for new features in .net 4, but:
Can we please have a build which at least loads .net 4 dlls?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Update:
I got the latest sources and compiled, using 2010. This needed fixing: in ExternalXmlSummaryCache:
Note the "??string.Empty" added in the final line, to fix a NULL ref error. Maybe an active developer can add that fix?
public string GetSummary(string memberID, Type declaringType) {
//extract member type (T:, P:, etc.)
string memberType = memberID.Substring(0, 2);
//extract member name
int i = memberID.IndexOf('(');
string memberName = i > -1 ? memberID.Substring(memberID.LastIndexOf('.', i) + 1)
: memberID.Substring(memberID.LastIndexOf('.') + 1);
//the member id in the declaring assembly
string key = memberType + declaringType.FullName??string.Empty.Replace("+", ".") + "." + memberName;
With this fix, I documented aboout 25 dlls in 10 minutes, all of which are .net 4.0.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2011-03-17
Thanks @travor2006 - that fixed one issue for me.
Also running on 64 bit Win 7 and found i had to change "ProgramFiles" to "ProgramFilesX86" in HtmlHelp.cs in the HtmlHelpCompiler method.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to use NDoc on a project that I upgraded from Visual Studio 2008 to 2010. Everything worked find on 2008, but with 2010, I get:
Could not load file or assembly 'c:\tools\cruisecontrol\projects\cs-encog-core\stage\src\encog-core-cs\bin\release\encog-core-cs.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Exception: NDoc3.Core.DocumenterException
Could not load file or assembly 'c:\tools\cruisecontrol\projects\cs-encog-core\stage\src\encog-core-cs\bin\release\encog-core-cs.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Exception: System.BadImageFormatException
Could not load file or assembly 'c:\tools\cruisecontrol\projects\cs-encog-core\stage\src\encog-core-cs\bin\release\encog-core-cs.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Same here.
It looks like a test was done on "recompiling a .net 3.5 app with VS2010", which would work, as the framework is the same.
However, the latest published beta only permits frameworks up to 3.5 to be selected, and was most likely compiled against the 3.5 framework, so: It is not able to "reflect" into the .net 4.0 code.
If the sources are recompiled against framework 4, and framework 4 is added to the list in configuration, this may go a long way to addressing this.
There is clearly other work (needed or in progress) for new features in .net 4, but:
Can we please have a build which at least loads .net 4 dlls?
Update:
I got the latest sources and compiled, using 2010. This needed fixing: in ExternalXmlSummaryCache:
Note the "??string.Empty" added in the final line, to fix a NULL ref error. Maybe an active developer can add that fix?
public string GetSummary(string memberID, Type declaringType) {
//extract member type (T:, P:, etc.)
string memberType = memberID.Substring(0, 2);
//extract member name
int i = memberID.IndexOf('(');
string memberName = i > -1 ? memberID.Substring(memberID.LastIndexOf('.', i) + 1)
: memberID.Substring(memberID.LastIndexOf('.') + 1);
//the member id in the declaring assembly
string key = memberType + declaringType.FullName??string.Empty.Replace("+", ".") + "." + memberName;
With this fix, I documented aboout 25 dlls in 10 minutes, all of which are .net 4.0.
Thanks @travor2006 - that fixed one issue for me.
Also running on 64 bit Win 7 and found i had to change "ProgramFiles" to "ProgramFilesX86" in HtmlHelp.cs in the HtmlHelpCompiler method.
Where can I find the source files
Install svn.
Run following in commandline to check out the latest source:
svn co https://ndoc3.svn.sourceforge.net/svnroot/ndoc3 ndoc3
You could browse latest source code after login source forge:https://sourceforge.net/projects/ndoc3/develop
Hey guys
Thanks for making this work with 4.0 saved my sooo much time.
Cheers
Dave
Hi, there is a build ready to install to use with .net framework or only from the source code?
Thanks!