XmlSchemaException in App.config using UIP Application Block

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • SparkPlug

    XmlSchemaException in App.config using UIP Application Block

    Does anyone know why I might be getting an XmlSchemaExcept ion in App.config
    configured as below to use the UIP Application Block?

    I get the following error for every element, sub-element and attribute
    within the <uipConfigurati on> element:

    Message 1 Could not find schema information for the element
    'uipConfigurati on'.
    Message 2 Could not find schema information for the element 'objectTypes'.
    Message 3 Could not find schema information for the element 'iViewManager'.
    .... etc. etc.

    My App.config file:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuratio n>
    <configSections >
    <section name="uipConfig uration"
    type="Microsoft .ApplicationBlo cks.UIProcess.U IPConfigHandler ,
    Microsoft.Appli cationBlocks.UI Process,
    Version=1.0.1.0 ,
    Culture=neutral ,
    PublicKeyToken= null"
    />
    </configSections>
    <uipConfigurati on>
    <objectTypes>
    <iViewManager
    name="WindowsFo rmViewManager"
    type="Microsoft .ApplicationBlo cks.UIProcess.W indowsFormViewM anager,
    Microsoft.Appli cationBlocks.UI Process,
    Version=1.0.1.0 ,
    Culture=neutral ,
    PublicKeyToken= null"
    />
    <state
    name="TestState "
    type="BusinessL ayer.TestState, BusinessLayer,
    Version=null,
    Culture=neutral ,
    PublicKeyToken= null"
    />

    <controller
    name="TestContr oller"
    type="Presentat ionLayer.Contro llers.TestContr oller,
    SBMPresentation Layer,
    Version=1.0.1.0 ,
    Culture=neutral ,
    PublicKeyToken= null"
    />
    <statePersisten ceProvider
    name="IsolatedS toragePersisten ce"
    type="Microsoft .ApplicationBlo cks.UIProcess.I solatedStorageP ersistence,
    Microsoft.Appli cationBlocks.UI Process,
    Version=1.0.1.0 ,
    Culture=neutral ,
    PublicKeyToken= null"
    />


    </objectTypes>
    <views>
    <view
    name="TestView"
    type="Presentat ionLayer.Views. TestView,
    PresentationLay er,
    Version=null,
    Culture=neutral ,
    PublicKeyToken= null"
    controller="Tes tController"
    stayOpen="true"
    floatable="true "
    />

    </views>
    <!--
    <sharedTransiti ons>
    </sharedTransitio ns>
    -->
    <!--
    <navigationGrap h>
    </navigationGraph >
    -->
    <!--
    <uipWizard>
    </uipWizard>
    -->
    <!--
    <userControls >
    </userControls>
    -->
    </uipConfiguratio n>
    <system.diagnos tics>
    <sources>
    <!-- This section defines the logging configuration for
    My.Application. Log -->
    <source name="DefaultSo urce" switchName="Def aultSwitch">
    <listeners>
    <add name="FileLog"/>
    <!-- Uncomment the below section to write to the Application Event Log
    -->
    <!--<add name="EventLog"/>-->
    </listeners>
    </source>
    </sources>
    <switches>
    <add name="DefaultSw itch" value="Informat ion" />
    </switches>
    <sharedListener s>
    <add name="FileLog"
    type="Microsoft .VisualBasic.Lo gging.FileLogTr aceListener,
    Microsoft.Visua lBasic, Version=8.0.0.0 , Culture=neutral ,
    PublicKeyToken= b03f5f7f11d50a3 a, processorArchit ecture=MSIL"
    initializeData= "FileLogWri ter"/>
    <!-- Uncomment the below section and replace APPLICATION_NAM E with the
    name of your application to write to the Application Event Log -->
    <!--<add name="EventLog" type="System.Di agnostics.Event LogTraceListene r"
    initializeData= "APPLICATION_NA ME"/> -->
    </sharedListeners >
    </system.diagnost ics>

    </configuration>



    Thanks
  • Zafar Abbas

    #2
    Re: XmlSchemaExcept ion in App.config using UIP Application Block

    These are validation errors, are you trying to validate your file or just
    parse it. If you dont need validation, turn validation off when you create
    the validating reader in .NET.

    Zafar


    "SparkPlug" <SparkPlug@disc ussions.microso ft.com> wrote in message
    news:50450B7E-1A91-4F0A-9D2B-0EC804827A63@mi crosoft.com...[color=blue]
    > Does anyone know why I might be getting an XmlSchemaExcept ion in[/color]
    App.config[color=blue]
    > configured as below to use the UIP Application Block?
    >
    > I get the following error for every element, sub-element and attribute
    > within the <uipConfigurati on> element:
    >
    > Message 1 Could not find schema information for the element
    > 'uipConfigurati on'.
    > Message 2 Could not find schema information for the element 'objectTypes'.
    > Message 3 Could not find schema information for the element[/color]
    'iViewManager'.[color=blue]
    > ... etc. etc.
    >
    > My App.config file:
    >
    > <?xml version="1.0" encoding="utf-8" ?>
    > <configuratio n>
    > <configSections >
    > <section name="uipConfig uration"
    > type="Microsoft .ApplicationBlo cks.UIProcess.U IPConfigHandler ,
    > Microsoft.Appli cationBlocks.UI Process,
    > Version=1.0.1.0 ,
    > Culture=neutral ,
    > PublicKeyToken= null"
    > />
    > </configSections>
    > <uipConfigurati on>
    > <objectTypes>
    > <iViewManager
    > name="WindowsFo rmViewManager"
    > type="Microsoft .ApplicationBlo cks.UIProcess.W indowsFormViewM anager,
    > Microsoft.Appli cationBlocks.UI Process,
    > Version=1.0.1.0 ,
    > Culture=neutral ,
    > PublicKeyToken= null"
    > />
    > <state
    > name="TestState "
    > type="BusinessL ayer.TestState, BusinessLayer,
    > Version=null,
    > Culture=neutral ,
    > PublicKeyToken= null"
    > />
    >
    > <controller
    > name="TestContr oller"
    > type="Presentat ionLayer.Contro llers.TestContr oller,
    > SBMPresentation Layer,
    > Version=1.0.1.0 ,
    > Culture=neutral ,
    > PublicKeyToken= null"
    > />
    > <statePersisten ceProvider
    > name="IsolatedS toragePersisten ce"
    > type="Microsoft .ApplicationBlo cks.UIProcess.I solatedStorageP ersistence,
    > Microsoft.Appli cationBlocks.UI Process,
    > Version=1.0.1.0 ,
    > Culture=neutral ,
    > PublicKeyToken= null"
    > />
    >
    >
    > </objectTypes>
    > <views>
    > <view
    > name="TestView"
    > type="Presentat ionLayer.Views. TestView,
    > PresentationLay er,
    > Version=null,
    > Culture=neutral ,
    > PublicKeyToken= null"
    > controller="Tes tController"
    > stayOpen="true"
    > floatable="true "
    > />
    >
    > </views>
    > <!--
    > <sharedTransiti ons>
    > </sharedTransitio ns>
    > -->
    > <!--
    > <navigationGrap h>
    > </navigationGraph >
    > -->
    > <!--
    > <uipWizard>
    > </uipWizard>
    > -->
    > <!--
    > <userControls >
    > </userControls>
    > -->
    > </uipConfiguratio n>
    > <system.diagnos tics>
    > <sources>
    > <!-- This section defines the logging configuration for
    > My.Application. Log -->
    > <source name="DefaultSo urce" switchName="Def aultSwitch">
    > <listeners>
    > <add name="FileLog"/>
    > <!-- Uncomment the below section to write to the Application Event Log
    > -->
    > <!--<add name="EventLog"/>-->
    > </listeners>
    > </source>
    > </sources>
    > <switches>
    > <add name="DefaultSw itch" value="Informat ion" />
    > </switches>
    > <sharedListener s>
    > <add name="FileLog"
    > type="Microsoft .VisualBasic.Lo gging.FileLogTr aceListener,
    > Microsoft.Visua lBasic, Version=8.0.0.0 , Culture=neutral ,
    > PublicKeyToken= b03f5f7f11d50a3 a, processorArchit ecture=MSIL"
    > initializeData= "FileLogWri ter"/>
    > <!-- Uncomment the below section and replace APPLICATION_NAM E with the
    > name of your application to write to the Application Event Log -->
    > <!--<add name="EventLog" type="System.Di agnostics.Event LogTraceListene r"
    > initializeData= "APPLICATION_NA ME"/> -->
    > </sharedListeners >
    > </system.diagnost ics>
    >
    > </configuration>
    >
    >
    >
    > Thanks[/color]


    Comment

    • SparkPlug

      #3
      Re: XmlSchemaExcept ion in App.config using UIP Application Block


      "Zafar Abbas" wrote:
      [color=blue]
      > These are validation errors, are you trying to validate your file or just
      > parse it. If you dont need validation, turn validation off when you create
      > the validating reader in .NET.[/color]

      That sounds useful. I've only just begun creating an application based on
      UIPAB so I am just trying to build & run it with one simple View and one
      simple Controller to test that I have written the config correctly.

      Is it trying to validate the config file but doesn't have access to the
      schema? If so, how can I prevent Visual Studio (Express) from trying to
      validate the app.config?

      FYI the message in the Visual Studio Immediate Window is

      A first chance exception of type 'System.Xml.Sch ema.XmlSchemaEx ception'
      occurred in System.Xml.dll
      A first chance exception of type
      'System.Configu ration.Configur ationErrorsExce ption' occurred in
      System.Configur ation.dll
      A first chance exception of type
      'Microsoft.Appl icationBlocks.U IProcess.UIPExc eption' occurred in
      Microsoft.Appli cationBlocks.UI Process.dll

      and the debugging process appears to be showing me the exception is being
      thrown from a statement is the UIPConfigHandle r.cs that says:

      validatingReade r.Schemas.Add( XmlSchema.Read( new XmlTextReader(
      streamReader ), null ) );

      Thanks for your help.

      Comment

      • Priya Lakshminarayanan

        #4
        Re: XmlSchemaExcept ion in App.config using UIP Application Block

        If the exception is thrown from the following line that means that there was
        a problem in parsing and compiling the schema that is being added.

        validatingReade r.Schemas.Add( XmlSchema.Read( new XmlTextReader(
        streamReader ), null ) );

        Can you write out the exception message and check the error in the schema?

        Thanks,
        Priya

        "SparkPlug" <SparkPlug@disc ussions.microso ft.com> wrote in message
        news:9A6300BB-F2E8-40DE-8581-B04A98F69F11@mi crosoft.com...[color=blue]
        >
        > "Zafar Abbas" wrote:
        >[color=green]
        >> These are validation errors, are you trying to validate your file or just
        >> parse it. If you dont need validation, turn validation off when you
        >> create
        >> the validating reader in .NET.[/color]
        >
        > That sounds useful. I've only just begun creating an application based on
        > UIPAB so I am just trying to build & run it with one simple View and one
        > simple Controller to test that I have written the config correctly.
        >
        > Is it trying to validate the config file but doesn't have access to the
        > schema? If so, how can I prevent Visual Studio (Express) from trying to
        > validate the app.config?
        >
        > FYI the message in the Visual Studio Immediate Window is
        >
        > A first chance exception of type 'System.Xml.Sch ema.XmlSchemaEx ception'
        > occurred in System.Xml.dll
        > A first chance exception of type
        > 'System.Configu ration.Configur ationErrorsExce ption' occurred in
        > System.Configur ation.dll
        > A first chance exception of type
        > 'Microsoft.Appl icationBlocks.U IProcess.UIPExc eption' occurred in
        > Microsoft.Appli cationBlocks.UI Process.dll
        >
        > and the debugging process appears to be showing me the exception is being
        > thrown from a statement is the UIPConfigHandle r.cs that says:
        >
        > validatingReade r.Schemas.Add( XmlSchema.Read( new XmlTextReader(
        > streamReader ), null ) );
        >
        > Thanks for your help.
        >[/color]


        Comment

        • SparkPlug

          #5
          Re: XmlSchemaExcept ion in App.config using UIP Application Block


          "Priya Lakshminarayana n" wrote:
          [color=blue]
          > If the exception is thrown from the following line that means that there was
          > a problem in parsing and compiling the schema that is being added.[/color]

          Yes I agree that is the problem.
          [color=blue]
          > validatingReade r.Schemas.Add( XmlSchema.Read( new XmlTextReader(
          > streamReader ), null ) );
          >
          > Can you write out the exception message and check the error in the schema?[/color]

          I am using only Visual Basic 2005 Express Edition and will not provide
          exception stack traces for exceptions thrown in referenced C# code, the only
          exception messages are in the Immediate Window and Error List as I described
          previously and repost below:

          Immediate Window:
          A first chance exception of type 'System.Xml.Sch ema.XmlSchemaEx ception'
          occurred in System.Xml.dll
          A first chance exception of type
          'System.Configu ration.Configur ationErrorsExce ption' occurred in
          System.Configur ation.dll
          A first chance exception of type
          'Microsoft.Appl icationBlocks.U IProcess.UIPExc eption' occurred in
          Microsoft.Appli cationBlocks.UI Process.dll
          A first chance exception of type
          'Microsoft.Appl icationBlocks.U IProcess.UIPExc eption' occurred in
          Microsoft.Appli cationBlocks.UI Process.dll
          A first chance exception of type
          'Microsoft.Appl icationBlocks.U IProcess.UIPExc eption' occurred in
          Microsoft.Appli cationBlocks.UI Process.dll
          ....

          .... ad nauseam

          Error List:
          Message 1 Could not find schema information for the element
          'uipConfigurati on'.
          Message 2 Could not find schema information for the element 'objectTypes'.
          Message 3 Could not find schema information for the element 'iViewManager'.
          ....

          .... etc. for every element and attribute in the <uipConfigurati on> section

          I currently think that the process of upgrading the UIP solution to Visual
          C# 2005 EE (I only have Express Editions at home) has caused a problem so
          that the UIPConfigSchema .xsd is not being correctly built into the
          UIProcess.dll.

          This screen image may indicate that but I'm not sure:


          I am currently asking a friend to try building the UIPAB on VS 2003 with
          ..NET 1.1 to see that solves the problem. I will post the results on this
          thread but would welcome any comments/insights/suggestions in the meantime.

          Thanks.

          Comment

          • SparkPlug

            #6
            Re: XmlSchemaExcept ion in App.config using UIP Application Block



            "SparkPlug" wrote:

            [color=blue]
            > I am using only Visual Basic 2005 Express Edition and will not provide
            > exception stack traces for exceptions thrown in referenced C# code,[/color]

            Oops, that should have said "I am using only Visual Basic 2005 Express
            Edition and *it* will not provide exception stack traces for exceptions
            thrown in referenced C# code"

            If *it* gave me an exception report I would gladly pass it on!!! :-)

            Comment

            • Priya Lakshminarayanan

              #7
              Re: XmlSchemaExcept ion in App.config using UIP Application Block

              Can you try a smaller code sample by adding the UIP schema directly into a
              XmlSchemaSet and check what errors/exception you get?

              XmlSchemaSet schemas = new XmlSchemaSet();
              schemas.Add(nul l, "UipConfigSchem a.xsd");
              schemas.Compile ();

              Thanks,
              Priya

              "SparkPlug" <SparkPlug@disc ussions.microso ft.com> wrote in message
              news:4FA7763E-CAC9-47EA-886D-3A826E0DA28F@mi crosoft.com...[color=blue]
              >
              >
              > "SparkPlug" wrote:
              >
              >[color=green]
              >> I am using only Visual Basic 2005 Express Edition and will not provide
              >> exception stack traces for exceptions thrown in referenced C# code,[/color]
              >
              > Oops, that should have said "I am using only Visual Basic 2005 Express
              > Edition and *it* will not provide exception stack traces for exceptions
              > thrown in referenced C# code"
              >
              > If *it* gave me an exception report I would gladly pass it on!!! :-)[/color]


              Comment

              • SparkPlug

                #8
                Re: XmlSchemaExcept ion in App.config using UIP Application Block


                "Priya Lakshminarayana n" wrote:
                [color=blue]
                > Can you try a smaller code sample by adding the UIP schema directly into a
                > XmlSchemaSet and check what errors/exception you get?
                >
                > XmlSchemaSet schemas = new XmlSchemaSet();
                > schemas.Add(nul l, "UipConfigSchem a.xsd");
                > schemas.Compile ();[/color]

                Sorry for the delay in replying. I did as you advised and the exception
                message is below.

                System.Xml.Sche ma.XmlSchemaExc eption was unhandled
                Message="Wildca rd '##any' allows element 'statePersisten ceProvider', and
                causes the content model to become ambiguous. A content model must be formed
                such that during validation of an element information item sequence, the
                particle contained directly, indirectly or implicitly therein with which to
                attempt to validate each item in the sequence in turn can be uniquely
                determined without examining the content or attributes of that item, and
                without any information about the items in the remainder of the sequence."
                Source="System. Xml"
                StackTrace:
                at System.Xml.Sche ma.XmlSchemaSet .InternalValida tionCallback(Ob ject
                sender, ValidationEvent Args e)
                at
                System.Xml.Sche ma.BaseProcesso r.SendValidatio nEvent(XmlSchem aException e,
                XmlSeverityType severity)
                at System.Xml.Sche ma.Compiler.Com pileElement(Xml SchemaElement xe)
                at
                System.Xml.Sche ma.Compiler.Com pileParticleEle ments(XmlSchema ComplexType
                complexType, XmlSchemaPartic le particle)
                at
                System.Xml.Sche ma.Compiler.Com pileParticleEle ments(XmlSchema ComplexType
                complexType, XmlSchemaPartic le particle)
                at
                System.Xml.Sche ma.Compiler.Com pileComplexType Elements(XmlSch emaComplexType
                complexType)
                at System.Xml.Sche ma.Compiler.Com pile()
                at System.Xml.Sche ma.Compiler.Exe cute(XmlSchemaS et schemaSet,
                SchemaInfo schemaCompiledI nfo)
                at System.Xml.Sche ma.XmlSchemaSet .Compile()
                at UIPAB_Sandbox.M ainClass.Main(S tring[] args) in D:\Visual Studio
                2005\Projects\U IPAB_Sandbox\UI PAB_Sandbox\Mai nClass.vb:line 13
                at System.AppDomai n.nExecuteAssem bly(Assembly assembly, String[] args)
                at System.AppDomai n.ExecuteAssemb ly(String assemblyFile, Evidence
                assemblySecurit y, String[] args)
                at Microsoft.Visua lStudio.Hosting Process.HostPro c.RunUsersAssem bly()
                at System.Threadin g.ThreadHelper. ThreadStart_Con text(Object state)
                at System.Threadin g.ExecutionCont ext.Run(Executi onContext
                executionContex t, ContextCallback callback, Object state)
                at System.Threadin g.ThreadHelper. ThreadStart()


                I have also identified a forum thread that appears to address this problem
                (explained as something to do with .NET 2.0 handling XML differently to .NET
                1.1 which the UIPAB was built on) and offers a solution at
                A broad category of Microsoft tools, languages, and frameworks for software development. Designed to support developers in building, debugging, and deploying applications across various platforms.


                Implementing the solution prevents the original exception.

                I would still welcome your comments or insights regarding this issue.

                Hopefully, one day soon this *important* application block will be properly
                ported to the .NET 2.0 Framework (how about it, Microsoft?!!)





                Comment

                Working...