DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: XmlSchemaException in App.config using UIP Application Block

  1. #1
    Join Date
    Mar 2006
    Posts
    15

    Question 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 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:
    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    	<configSections>
    		<section name="uipConfiguration"
    			type="Microsoft.ApplicationBlocks.UIProcess.UIPConfigHandler, 
    				Microsoft.ApplicationBlocks.UIProcess, 
    				Version=1.0.1.0,
    				Culture=neutral,
    				PublicKeyToken=null" 
    		/>
    	</configSections>
    	<uipConfiguration>
    		<objectTypes>
    			<iViewManager 
    				name="WindowsFormViewManager"
    				type="Microsoft.ApplicationBlocks.UIProcess.WindowsFormViewManager,
    				Microsoft.ApplicationBlocks.UIProcess,
    				Version=1.0.1.0, 
    				Culture=neutral, 
    				PublicKeyToken=null" 
    		/>
    			<state 
    				name="TestState" 
    				type="PresentationLayer.TestState, 
    				PresentationLayer,
    				Version=null, 
    				Culture=neutral, 
    				PublicKeyToken=null" 
    		/>
    
    			<controller
    				name="TestController"
    				type="Common.TestController, 
    				Common, 
    				Version=null, 
    				Culture=neutral, 
    				PublicKeyToken=null" 
    		/>
    			<statePersistenceProvider 
    				name="IsolatedStoragePersistence" 
    				type="Microsoft.ApplicationBlocks.UIProcess.IsolatedStoragePersistence,
    				Microsoft.ApplicationBlocks.UIProcess, 
    				Version=1.0.1.0, 
    				Culture=neutral, 
    				PublicKeyToken=null"
    		/>
    
    
    		</objectTypes>
    		<views>
    			<view 
    				name="TestView" 
    				type="PresentationLayer.TestView, 
    				PresentationLayer, 
    				Version=null, 
    				Culture=neutral, 
    				PublicKeyToken=null" 
    				controller="TestController" 
    				stayOpen="true"
    				floatable="true" 
    		/>
    
    		</views>
    	</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.FileLogTraceListener, 
    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>
    The exception is thrown in UIPConfigHandler.cs at the statement:

    Code:
    validatingReader.Schemas.Add( XmlSchema.Read( new XmlTextReader( streamReader ), null ) );
    If you don't know why the exception is thrown maybe you could suggest a way to narrow down the possible cause or know any further information I could provide to help answer this question?

    Thanks v. much!
    Mark

  2. #2
    Join Date
    Sep 2004
    Posts
    52
    Having looked at the UIP code, that is weird. It's just the XSD validation failing for some reason. Some possibilities to look at:

    1. The XSD (UIPConfigSchema.xsd) may not be embedded in your UIP DLL. Make sure it has been compiled as an embedded resource.

    2. Try running one of the sample apps with your build of UIP - that might tell you more.

    HTH,
    Kent

  3. #3
    Join Date
    Mar 2006
    Posts
    15

    Question

    Thanks, Kent.

    You may be onto something there. I built the UIProcess.dll with Visual C# 2005 Express Edition. Listed in the solution explorer is the UIPConfigSchema.xsd but a tree sub-menu item under this called "UIPConfigSchema.xsx" has a warning triangle beside it (see image attached) and upon trying to open this file an alert appears that states:

    The item 'UIPConfigSchema.xsx' does not appear in the project directory. It may have been moved, renamed or deleted.
    I don't know what this means or if it is significant.

    I only use Visual C# 2005 Express Edition which had to upgrade the UIProcess solution in order to open it (although there were no errors reported maybe it got messed up). This is the only version I have at the moment but perhaps it only works properly with VS 2003? I'd be curious to know if anyone has built the UIP in 2005 EE and it worked OK.

    What about if I obtained a pre-compiled UIProcess.dll from somewhere else and used that?

    Thanks
    Mark
    Attached Images Attached Images
    Last edited by mjtech; 03-15-2006 at 08:19 AM.

  4. #4
    Join Date
    Sep 2004
    Posts
    52
    No problem Mark. Yes, you could try a pre-built version first to verify the issue. Also, try right-clicking the XSD file and selecting properties. Make sure the build action is "Embedded Resource".

    I believe the XSX file is just so the designer can keep track of where objects in the XSD have been dragged etcetera.

    HTH,
    Kent

  5. #5
    Join Date
    Mar 2006
    Posts
    15

    Exclamation

    I tried using a pre-built dll and also the XSD file's build action is "Embedded Resource". I am, for the moment, completely stuck as to how to overcome this impasseť. I wonder if anyone else has got the UIPAB2 to work with the Visual Express Editions?

    Do you know which version of Visual Studio the UIPAB 2.0 was designed to work with - 2003 or 2005? I would have thought anything that works in 2005 works with the 2005 Express Editions too but I always have to convert the solutions before I can open them in the EEs.

    Oh, and I forgot to mention last time that the QuickStart samples have the same problems too (referencing the same UIProcess.dll as my own project).

    I'm looking at your Ingenious MVC right now. I'd still like to get this to work, though, as I think this problem must be solvable somehow.

    Thanks.
    Mark
    Last edited by mjtech; 03-15-2006 at 07:02 PM.

  6. #6
    Join Date
    Mar 2006
    Posts
    15

    Thumbs up

    This thread here indicates that .NET 2.0 handles XML or configs in a different way to .NET 1.1 and as the UIPAB was built for .NET 1.1 this was the source of the XmlSchemaException.

    I don't completely understand what the problem was but commenting out the offending line in the UIPConfigSchema.xsd, as advised, seems to have done the trick

    There very well be more compatility problems as the UIPAB 2.0 reference states as a system requirement .NET 1.1.

    UIPAB 2.0 needs to be updated for .NET 2.0. Hopefully, the patterns team will move on this soon.
    Last edited by mjtech; 03-16-2006 at 08:14 PM.

Similar Threads

  1. Replies: 5
    Last Post: 03-14-2006, 10:23 PM
  2. Web Applications and Microsoft Application Block
    By softwarenovice in forum Mobile
    Replies: 1
    Last Post: 07-10-2005, 11:48 AM
  3. Replies: 0
    Last Post: 11-26-2002, 12:09 AM
  4. Replies: 0
    Last Post: 11-26-2002, 12:05 AM
  5. Inventory Management Application Using VB
    By Krishna in forum vb.announcements
    Replies: 0
    Last Post: 11-26-2002, 12:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center