By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,081 Members | 862 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,081 IT Pros & Developers. It's quick & easy.

XmlSchemaException in App.config using UIP Application Block

P: n/a
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
Mar 13 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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" <Sp*******@discussions.microsoft.com> wrote in message
news:50**********************************@microsof t.com...
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

Mar 14 '06 #2

P: n/a

"Zafar Abbas" wrote:
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.


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.

Mar 14 '06 #3

P: n/a
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" <Sp*******@discussions.microsoft.com> wrote in message
news:9A**********************************@microsof t.com...

"Zafar Abbas" wrote:
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.


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.

Mar 15 '06 #4

P: n/a

"Priya Lakshminarayanan" wrote:
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.
Yes I agree that is the problem.
validatingReader.Schemas.Add( XmlSchema.Read( new XmlTextReader(
streamReader ), null ) );

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


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.

Mar 15 '06 #5

P: n/a


"SparkPlug" wrote:

I am using only Visual Basic 2005 Express Edition and will not provide
exception stack traces for exceptions thrown in referenced C# code,


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!!! :-)
Mar 15 '06 #6

P: n/a
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" <Sp*******@discussions.microsoft.com> wrote in message
news:4F**********************************@microsof t.com...


"SparkPlug" wrote:

I am using only Visual Basic 2005 Express Edition and will not provide
exception stack traces for exceptions thrown in referenced C# code,


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

Mar 17 '06 #7

P: n/a

"Priya Lakshminarayanan" wrote:
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();


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

Mar 20 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.