|
Home > Archive > Microsoft Content Management Server > May 2007 > Migration Assessment Tool Exception
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Migration Assessment Tool Exception
|
|
| dahazeman 2007-05-15, 1:19 pm |
| I'm trying to run the MCMS Migration Assessment Tool, but I'm getting
an exception. It only happens when I check the Code Analysis option;
I've run the tool successfully without analyzing the code, but we
obviously need to do that step as well. The exception is:
-------------------------------------------------------------
While processing c:\<filepath>\<filename>.ascx:
System.IndexOutOfRangeException: Index was outside the bounds of the
array.
at
Microsoft.ContentManagement.AssessmentTool.AspNetProcessor.Parser.AspParser.NextChar(Int32
off)
at
Microsoft.ContentManagement.AssessmentTool.AspNetProcessor.Parser.AspParser.ConsumeHtmlComment()
at
Microsoft.ContentManagement.AssessmentTool.AspNetProcessor.Parser.AspParser.Parse()
at
Microsoft.ContentManagement.AssessmentTool.AspNetProcessor.CodeAnalyzer.AnalyzeAscxFile(String
aspFile, MSILCollector collector, ArrayList processedElements)
Looking at the code for that user control, there are two places where
an index of any sort is checked:
It is loading the contents of an XmlPlaceholder into an XmlDocument
object.
foreach(XmlNode xn in xmlDoc.DocumentElement.ChildNodes) {
if(xn.InnerText.Length>4) {
if(xn.InnerText.Substring(0,4)=="XXXX") {
string someString = xn.InnerText.Remove(0, 4);
I added the check for the InnerText.Length just today to see if that
was what caused the exception, but the assessment tool still stops on
this user control.
There are no other instances of using an index of any sort in this
code-behind page. Is there something we're missing that might generate
this exception? Could this be a bug with the assessment tool? There
are a number of postings created with the template that has this user
control on it. I've randomly browsed to a few in debug mode, but none
of them are generating an exception.
Any suggestions will be appreciated.
Thanks,
Jason
| |
| dahazeman 2007-05-15, 7:15 pm |
| Wow! Ok...are you ready for this?
I spent a good four hours going through our code, debugging
everything. I checked every posting that used the template that held
the faulty user control. There was nothing wrong with our user control
at all. It just didn't make sense. Finally, I did something I
shouldn't have: I decompiled the assessment tool's AspNetProcessor.dll
and followed through the code. It turns out it was time well spent,
but perhaps a bug in the assessment tool.
It turns out that there is a Parse() method in the
Microsoft.ContentManagement.AssessmentTool.AspNetProcessor.Parser
class that was referencing the character immediately following an HTML
comment. The problem was that this particular ascx file ended with an
HTML comment but no carriage return/line feed after the comment. So
the Parse() method received a null value and threw an exception. I
placed my cursor at the end of the comment in the ascx file, hit
enter, saved it, and re-ran the assessment tool. BINGO. I have
results.
On May 15, 11:41 am, dahazeman <hazyshadeofg...@hotmail.com> wrote:
> I'm trying to run the MCMS Migration Assessment Tool, but I'm getting
> an exception. It only happens when I check the Code Analysis option;
> I've run the tool successfully without analyzing the code, but we
> obviously need to do that step as well. The exception is:
> -------------------------------------------------------------
> While processing c:\<filepath>\<filename>.ascx:
> System.IndexOutOfRangeException: Index was outside the bounds of the
> array.
> atMicrosoft.ContentManagement.AssessmentTool.AspNetProcessor.Parser.As=
pParser=AD.NextChar(Int32
> off)
> at
> Microsoft.ContentManagement.AssessmentTool.AspNetProcessor.Parser.AspPars=
er=AD.ConsumeHtmlComment()
> at
> Microsoft.ContentManagement.AssessmentTool.AspNetProcessor.Parser.AspPars=
er=AD.Parse()
> at
> Microsoft.ContentManagement.AssessmentTool.AspNetProcessor.CodeAnalyzer.A=
na=ADlyzeAscxFile(String
> aspFile, MSILCollector collector, ArrayList processedElements)
>
> Looking at the code for that user control, there are two places where
> an index of any sort is checked:
>
> It is loading the contents of an XmlPlaceholder into an XmlDocument
> object.
> foreach(XmlNode xn in xmlDoc.DocumentElement.ChildNodes) {
> if(xn.InnerText.Length>4) {
> if(xn.InnerText.Substring(0,4)=3D=3D"XXXX") {
> string someString =3D xn.InnerText.Remove(0, 4);
>
> I added the check for the InnerText.Length just today to see if that
> was what caused the exception, but the assessment tool still stops on
> this user control.
>
> There are no other instances of using an index of any sort in this
> code-behind page. Is there something we're missing that might generate
> this exception? Could this be a bug with the assessment tool? There
> are a number of postings created with the template that has this user
> control on it. I've randomly browsed to a few in debug mode, but none
> of them are generating an exception.
>
> Any suggestions will be appreciated.
>
> Thanks,
> Jason
| |
|
| Dear dahazeman
I'm having similar probelms but not necessarily the one you found.
Here is my error?
While calculating results: System.ArgumentNullException: Value cannot be null.
Parameter name: assemblyName
at
Microsoft.ContentManagement.AssessmentTool.AspNetProcessor.AspRepresentation.CmsTypeResolutionHelper.ResolveRealName(String
ns, String className, DirectoryInfo binDirectory, String assemblyName, String
sourceName)
at
Microsoft.ContentManagement.AssessmentTool.AspNetProcessor.AspRepresentation.AspControl.RetrieveControlType()
at
Microsoft.ContentManagement.AssessmentTool.AspNetProcessor.AspRepresentation.CmsPlaceholderControlSearchCriteria.Applies(AspControl control)
at
Microsoft.ContentManagement.AssessmentTool.AspNetProcessor.AspRepresentation.AspElement. CollectPlaceholderControls(IControlSearc
hCriteria criteria)
at
Microsoft.ContentManagement.AssessmentTool.AspNetProcessor.CodeAnalyzer.GenerateFirstXmlResultFile(ArrayList
processedElements, MSILCollector collector, WebConfigAnalysis
webConfigAnalyzer, Hashtable projectLineCounts, ArrayList projectFiles,
ArrayList serviceElements, ArrayList skippedFiles)
Would be so kind as to send me the code?
Thanks
Tom Daria
tom.daria@fhlbcin.com
"dahazeman" wrote:
> Wow! Ok...are you ready for this?
>
> I spent a good four hours going through our code, debugging
> everything. I checked every posting that used the template that held
> the faulty user control. There was nothing wrong with our user control
> at all. It just didn't make sense. Finally, I did something I
> shouldn't have: I decompiled the assessment tool's AspNetProcessor.dll
> and followed through the code. It turns out it was time well spent,
> but perhaps a bug in the assessment tool.
>
> It turns out that there is a Parse() method in the
> Microsoft.ContentManagement.AssessmentTool.AspNetProcessor.Parser
> class that was referencing the character immediately following an HTML
> comment. The problem was that this particular ascx file ended with an
> HTML comment but no carriage return/line feed after the comment. So
> the Parse() method received a null value and threw an exception. I
> placed my cursor at the end of the comment in the ascx file, hit
> enter, saved it, and re-ran the assessment tool. BINGO. I have
> results.
>
>
>
> On May 15, 11:41 am, dahazeman <hazyshadeofg...@hotmail.com> wrote:
>
>
>
|
|
|
|
|