Migration Assessment Tool Exception
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > Migration Assessment Tool Exception




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Migration Assessment Tool Exception  
dahazeman


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-15-07 06: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.Anal
yzeAscxFile(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






[ Post a follow-up to this message ]



    Re: Migration Assessment Tool Exception  
dahazeman


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-16-07 12:15 AM

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







[ Post a follow-up to this message ]



    Re: Migration Assessment Tool Exception  
Tom


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-17-07 12:16 AM

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 nul
l.
Parameter name: assemblyName
at
Microsoft.ContentManagement.AssessmentTool.AspNetProcessor.AspRepresentation
.CmsTypeResolutionHelper.ResolveRealName(String
ns, String className, DirectoryInfo binDirectory, String assemblyName, Strin
g
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.Gene
rateFirstXmlResultFile(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: 
>
>
>





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:46 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register