Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 13th, 2006, 05:25 PM
SparkPlug
Guest
 
Posts: n/a
Default XmlSchemaException in App.config using UIP Application Block

Does anyone know why I might be getting an XmlSchemaException 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 <uipConfiguration> element:

Message 1 Could not find schema information for the element
'uipConfiguration'.
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" ?>
<configuration>
<configSections>
<section name="uipConfiguration"
type="Microsoft.ApplicationBlocks.UIProcess.UIPCon figHandler,
Microsoft.ApplicationBlocks.UIProcess,
Version=1.0.1.0,
Culture=neutral,
PublicKeyToken=null"
/>
</configSections>
<uipConfiguration>
<objectTypes>
<iViewManager
name="WindowsFormViewManager"
type="Microsoft.ApplicationBlocks.UIProcess.Window sFormViewManager,
Microsoft.ApplicationBlocks.UIProcess,
Version=1.0.1.0,
Culture=neutral,
PublicKeyToken=null"
/>
<state
name="TestState"
type="BusinessLayer.TestState, BusinessLayer,
Version=null,
Culture=neutral,
PublicKeyToken=null"
/>

<controller
name="TestController"
type="PresentationLayer.Controllers.TestController ,
SBMPresentationLayer,
Version=1.0.1.0,
Culture=neutral,
PublicKeyToken=null"
/>
<statePersistenceProvider
name="IsolatedStoragePersistence"
type="Microsoft.ApplicationBlocks.UIProcess.Isolat edStoragePersistence,
Microsoft.ApplicationBlocks.UIProcess,
Version=1.0.1.0,
Culture=neutral,
PublicKeyToken=null"
/>


</objectTypes>
<views>
<view
name="TestView"
type="PresentationLayer.Views.TestView,
PresentationLayer,
Version=null,
Culture=neutral,
PublicKeyToken=null"
controller="TestController"
stayOpen="true"
floatable="true"
/>

</views>
<!--
<sharedTransitions>
</sharedTransitions>
-->
<!--
<navigationGraph>
</navigationGraph>
-->
<!--
<uipWizard>
</uipWizard>
-->
<!--
<userControls>
</userControls>
-->
</uipConfiguration>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for
My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the Application Event Log
-->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceLi stener,
Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME with the
name of your application to write to the Application Event Log -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener"
initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>

</configuration>



Thanks
  #2  
Old March 14th, 2006, 01:35 AM
Zafar Abbas
Guest
 
Posts: n/a
Default Re: XmlSchemaException 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@discussions.microsoft.com> wrote in message
news:50450B7E-1A91-4F0A-9D2B-0EC804827A63@microsoft.com...[color=blue]
> Does anyone know why I might be getting an XmlSchemaException 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 <uipConfiguration> element:
>
> Message 1 Could not find schema information for the element
> 'uipConfiguration'.
> 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" ?>
> <configuration>
> <configSections>
> <section name="uipConfiguration"
> type="Microsoft.ApplicationBlocks.UIProcess.UIPCon figHandler,
> Microsoft.ApplicationBlocks.UIProcess,
> Version=1.0.1.0,
> Culture=neutral,
> PublicKeyToken=null"
> />
> </configSections>
> <uipConfiguration>
> <objectTypes>
> <iViewManager
> name="WindowsFormViewManager"
> type="Microsoft.ApplicationBlocks.UIProcess.Window sFormViewManager,
> Microsoft.ApplicationBlocks.UIProcess,
> Version=1.0.1.0,
> Culture=neutral,
> PublicKeyToken=null"
> />
> <state
> name="TestState"
> type="BusinessLayer.TestState, BusinessLayer,
> Version=null,
> Culture=neutral,
> PublicKeyToken=null"
> />
>
> <controller
> name="TestController"
> type="PresentationLayer.Controllers.TestController ,
> SBMPresentationLayer,
> Version=1.0.1.0,
> Culture=neutral,
> PublicKeyToken=null"
> />
> <statePersistenceProvider
> name="IsolatedStoragePersistence"
> type="Microsoft.ApplicationBlocks.UIProcess.Isolat edStoragePersistence,
> Microsoft.ApplicationBlocks.UIProcess,
> Version=1.0.1.0,
> Culture=neutral,
> PublicKeyToken=null"
> />
>
>
> </objectTypes>
> <views>
> <view
> name="TestView"
> type="PresentationLayer.Views.TestView,
> PresentationLayer,
> Version=null,
> Culture=neutral,
> PublicKeyToken=null"
> controller="TestController"
> stayOpen="true"
> floatable="true"
> />
>
> </views>
> <!--
> <sharedTransitions>
> </sharedTransitions>
> -->
> <!--
> <navigationGraph>
> </navigationGraph>
> -->
> <!--
> <uipWizard>
> </uipWizard>
> -->
> <!--
> <userControls>
> </userControls>
> -->
> </uipConfiguration>
> <system.diagnostics>
> <sources>
> <!-- This section defines the logging configuration for
> My.Application.Log -->
> <source name="DefaultSource" switchName="DefaultSwitch">
> <listeners>
> <add name="FileLog"/>
> <!-- Uncomment the below section to write to the Application Event Log
> -->
> <!--<add name="EventLog"/>-->
> </listeners>
> </source>
> </sources>
> <switches>
> <add name="DefaultSwitch" value="Information" />
> </switches>
> <sharedListeners>
> <add name="FileLog"
> type="Microsoft.VisualBasic.Logging.FileLogTraceLi stener,
> Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
> PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
> initializeData="FileLogWriter"/>
> <!-- Uncomment the below section and replace APPLICATION_NAME with the
> name of your application to write to the Application Event Log -->
> <!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener"
> initializeData="APPLICATION_NAME"/> -->
> </sharedListeners>
> </system.diagnostics>
>
> </configuration>
>
>
>
> Thanks[/color]


  #3  
Old March 14th, 2006, 02:55 PM
SparkPlug
Guest
 
Posts: n/a
Default Re: XmlSchemaException 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.Schema.XmlSchemaException'
occurred in System.Xml.dll
A first chance exception of type
'System.Configuration.ConfigurationErrorsException ' occurred in
System.Configuration.dll
A first chance exception of type
'Microsoft.ApplicationBlocks.UIProcess.UIPExceptio n' occurred in
Microsoft.ApplicationBlocks.UIProcess.dll

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

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

Thanks for your help.

  #4  
Old March 15th, 2006, 02:05 AM
Priya Lakshminarayanan
Guest
 
Posts: n/a
Default Re: XmlSchemaException 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.

validatingReader.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@discussions.microsoft.com> wrote in message
news:9A6300BB-F2E8-40DE-8581-B04A98F69F11@microsoft.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.Schema.XmlSchemaException'
> occurred in System.Xml.dll
> A first chance exception of type
> 'System.Configuration.ConfigurationErrorsException ' occurred in
> System.Configuration.dll
> A first chance exception of type
> 'Microsoft.ApplicationBlocks.UIProcess.UIPExceptio n' occurred in
> Microsoft.ApplicationBlocks.UIProcess.dll
>
> and the debugging process appears to be showing me the exception is being
> thrown from a statement is the UIPConfigHandler.cs that says:
>
> validatingReader.Schemas.Add( XmlSchema.Read( new XmlTextReader(
> streamReader ), null ) );
>
> Thanks for your help.
>[/color]


  #5  
Old March 15th, 2006, 01:15 PM
SparkPlug
Guest
 
Posts: n/a
Default Re: XmlSchemaException in App.config using UIP Application Block


"Priya Lakshminarayanan" 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]
> validatingReader.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.Schema.XmlSchemaException'
occurred in System.Xml.dll
A first chance exception of type
'System.Configuration.ConfigurationErrorsException ' occurred in
System.Configuration.dll
A first chance exception of type
'Microsoft.ApplicationBlocks.UIProcess.UIPExceptio n' occurred in
Microsoft.ApplicationBlocks.UIProcess.dll
A first chance exception of type
'Microsoft.ApplicationBlocks.UIProcess.UIPExceptio n' occurred in
Microsoft.ApplicationBlocks.UIProcess.dll
A first chance exception of type
'Microsoft.ApplicationBlocks.UIProcess.UIPExceptio n' occurred in
Microsoft.ApplicationBlocks.UIProcess.dll
....

.... ad nauseam

Error List:
Message 1 Could not find schema information for the element
'uipConfiguration'.
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 <uipConfiguration> 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:
http://uk.geocities.com/mjtech_uk/UI...udio2005EE.jpg

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.

  #6  
Old March 15th, 2006, 11:15 PM
SparkPlug
Guest
 
Posts: n/a
Default Re: XmlSchemaException 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!!! :-)
  #7  
Old March 17th, 2006, 10:35 PM
Priya Lakshminarayanan
Guest
 
Posts: n/a
Default Re: XmlSchemaException 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(null, "UipConfigSchema.xsd");
schemas.Compile();

Thanks,
Priya

"SparkPlug" <SparkPlug@discussions.microsoft.com> wrote in message
news:4FA7763E-CAC9-47EA-886D-3A826E0DA28F@microsoft.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]


  #8  
Old March 20th, 2006, 09:15 PM
SparkPlug
Guest
 
Posts: n/a
Default Re: XmlSchemaException in App.config using UIP Application Block


"Priya Lakshminarayanan" 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(null, "UipConfigSchema.xsd");
> schemas.Compile();[/color]

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

System.Xml.Schema.XmlSchemaException was unhandled
Message="Wildcard '##any' allows element 'statePersistenceProvider', 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.Schema.XmlSchemaSet.InternalValidationC allback(Object
sender, ValidationEventArgs e)
at
System.Xml.Schema.BaseProcessor.SendValidationEven t(XmlSchemaException e,
XmlSeverityType severity)
at System.Xml.Schema.Compiler.CompileElement(XmlSchem aElement xe)
at
System.Xml.Schema.Compiler.CompileParticleElements (XmlSchemaComplexType
complexType, XmlSchemaParticle particle)
at
System.Xml.Schema.Compiler.CompileParticleElements (XmlSchemaComplexType
complexType, XmlSchemaParticle particle)
at
System.Xml.Schema.Compiler.CompileComplexTypeEleme nts(XmlSchemaComplexType
complexType)
at System.Xml.Schema.Compiler.Compile()
at System.Xml.Schema.Compiler.Execute(XmlSchemaSet schemaSet,
SchemaInfo schemaCompiledInfo)
at System.Xml.Schema.XmlSchemaSet.Compile()
at UIPAB_Sandbox.MainClass.Main(String[] args) in D:\Visual Studio
2005\Projects\UIPAB_Sandbox\UIPAB_Sandbox\MainClas s.vb:line 13
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state)
at System.Threading.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
http://forums.asp.net/713774/ShowPost.aspx

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?!!)





 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles