My.Settings issue
My.Settings issue
My.Settings issue
My.Settings issue
My.Settings issue
My.Settings issue My.Settings issue My.Settings issue My.Settings issue My.Settings issue My.Settings issue My.Settings issue My.Settings issue
My.Settings issue My.Settings issue
My.Settings issue
Go Back  Xtreme Visual Basic Talk > > > My.Settings issue


Reply
 
Thread Tools Display Modes
  #1  
Old 01-28-2011, 07:25 PM
gpraceman's Avatar
gpracemanMy.Settings issue gpraceman is offline
Contributor

* Expert *
 
Join Date: Sep 2002
Location: Highlands Ranch, CO
Posts: 560
Question My.Settings issue


I have one user that experiences an ArgumentException exception whenever my app tries to retrieve a particular setting. The setting is an array of strings. This app has a large number of users and no one else has reported this error.

Code:
Stack Trace:
  at System.Configuration.SettingsPropertyValue.Deserialize()
  at System.Configuration.SettingsPropertyValue.get_PropertyValue()
  at System.Configuration.SettingsBase.GetPropertyValueByName(propertyName As String)
  at System.Configuration.SettingsBase.get_Item(propertyName As String)
  at System.Configuration.ApplicationSettingsBase.GetPropertyValue(propertyName As String)
  at System.Configuration.ApplicationSettingsBase.get_Item(propertyName As String)
  at LisanoEnterprises.GrandPrix.My.MySettings.get_ImportRosterMappings()
  at ...

System.ArgumentException        System.Object Deserialize()
The property 'ImportRosterMappings' could not be created from it's default value. Error message: Could not load
file or assembly '0 bytes loaded from System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
or one of its dependencies. An attempt was made to load a program with an incorrect format.
I looked at his user.config file and the values for that setting look as they should. I had the user try to reinstall the .NET Framework 3.5 SP1, but that did not solve the problem. This user is running XP SP3.

Here's what the entry in user.config looks like:
Code:
            <setting name="ImportRosterMappings" serializeAs="Xml">
                <value>
                    <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                        <string>0</string>
                        <string>1</string>
                        <string>2</string>
                        <string>3</string>
                        <string>4</string>
                        <string>5</string>
                        <string>6</string>
                        <string>7</string>
                        <string>8</string>
                    </ArrayOfString>
                </value>
            </setting>
__________________
Awana Grand Prix and Pinewood Derby racing - Where a child, an adult and a small block of wood combine for a lot of fun and memories.
Reply With Quote
  #2  
Old 01-28-2011, 07:45 PM
PlausiblyDamp's Avatar
PlausiblyDampMy.Settings issue PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

If you look in the designer does that setting have a default value associated with it? If so have you tried removing it? You may also want to check the app.config on this users machine to see if there is a default value for this setting in there, if so try removing the default and see if that helps.
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #3  
Old 01-28-2011, 08:37 PM
gpraceman's Avatar
gpracemanMy.Settings issue gpraceman is offline
Contributor

* Expert *
 
Join Date: Sep 2002
Location: Highlands Ranch, CO
Posts: 560
Default

The default value is the same array as I posted from the user.config file. I'll see if I can get the user to send me his app.config file.
__________________
Awana Grand Prix and Pinewood Derby racing - Where a child, an adult and a small block of wood combine for a lot of fun and memories.
Reply With Quote
  #4  
Old 01-29-2011, 01:00 PM
AtmaWeapon's Avatar
AtmaWeaponMy.Settings issue AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

Note the error message. It tries to load an assembly named System.dll, version 2.0. The " An attempt was made to load a program with an incorrect format." error message is what you get when a 64-bit application tries to load a 32-bit DLL or vice versa.

So the error happens because a System.dll of the wrong bitness is being loaded, and possibly the wrong version of the .NET Framework. That's very odd, and might be part of the reason why you only get one user out of many that reports this problem.

It's unlikely the user has Windows XP 64-bit, but it's worth asking. If so, is your application compiled for AnyCPU? If that's true, it might be worth compiling both an x86 and x64 specific version and seeing if either of them fixes the problem. If the user has 32-bit Windows XP, try sending an x86-only version of your application. If he still gets the error, it's possible something screwed up and installed some 64-bit DLLs on his machine. The fix might be as simple as completely uninstalling the .NET framework (may be possible on XP SP3, but 2.0 might have been a core component) then reinstalling it. It might be as difficult as reformatting and installing Windows again.

PlausiblyDamp may be right and it could be a problem with the default value. The error description is quite odd, and it may be incidental to the rest of the problem. But any time you see something about loading something of a bad format, it's usually related to an x86 vs. x64 clash.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #5  
Old 01-29-2011, 01:19 PM
gpraceman's Avatar
gpracemanMy.Settings issue gpraceman is offline
Contributor

* Expert *
 
Join Date: Sep 2002
Location: Highlands Ranch, CO
Posts: 560
Default

Well, he isn't running XP x64 as indicated by the below except from his exception report (I have a rather detailed custom exception reporter).

Code:
 CPU
   Intel(R) Celeron(R) M CPU        440  @ 1.86GHz
     Caption: x86 Family 6 Model 14 Stepping 12
     Name: Intel(R) Celeron(R) M CPU        440  @ 1.86GHz
Anyways, the target CPU for the app is x86 since, as far as I know, Microsoft has yet to come out with 64 bit database drivers.

I asked the user to delete out the app.config file (after he emails me his copy) and to reinstall the software. I am hoping it is just a corruption of the app.config file. Hadn't heard back from him yet.
__________________
Awana Grand Prix and Pinewood Derby racing - Where a child, an adult and a small block of wood combine for a lot of fun and memories.
Reply With Quote
Reply


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

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 On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
My.Settings issue
My.Settings issue
My.Settings issue My.Settings issue
My.Settings issue
My.Settings issue
My.Settings issue My.Settings issue My.Settings issue My.Settings issue My.Settings issue My.Settings issue My.Settings issue
My.Settings issue
My.Settings issue
 
My.Settings issue
My.Settings issue
 
-->