473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Can't make ApplicationScopedSettingAttribute work at all

In the following MSDN documentation:

http://msdn2.microsoft.com/en-us/lib...se(VS.80).aspx

there is an example of using ApplicationSettingsBase. I implemented the code
and it works as expected. However, I want application scoped settings, so I
changed UserScopedSetting to ApplicationScopedSetting. Now, it doesn't work
at all. No app.exe.config file is created and, of course, the settings are
not restored when the app is started subsequently.

What additional steps are required to use
ApplicationScopedSettingAttributes? Thanks!
Apr 6 '06 #1
5 4042
Hi Mountain,

That sample code is target at the UserScopedSettings. To use the
ApplicationScopedSettings you can manually add an app.config file (and its
values) to your project or add the application scoped values in your
project properties' setting's page.

But the application-scoped settings are read-only, in the case of the
default LocalFileSettingsProvider is used(e.g. local app.config file). So
the approach which that sample code used could not create and update the
application-scoped settings in the run-time.

Thanks!

Best regards,

Gary Chang
Microsoft Community Support
================================================== ====
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 7 '06 #2
Thank you for the reply. I need some further clarification. An example
showing how to use the ApplicationScopedSettings attribute would be helpful.

And my specific questions are:

If I manually add an app.config file as you suggest, I assume my app.config
sections must conform to a standard structure. Where is that structure
defined? (An example would be helpful.)

Are these the only differences between using ApplicationScopedSettings and
UserScopedSettings:
1. I must add an app.config file to my project.
2. I must manually define the application scoped settings in the app.config
file.
3. application scoped settings are read only.

It seems to me that there is more to it. I would guess that I also have to
implement all the code that reads the application scoped settings in the
app.config file and parses the text/XML into the appropriate .NET data types
(as well as handling all errors in the parsing, etc.). If I am right on this
point, then I can see no benefit from using the new ApplicationSettingsBase
with application scoped settings because it doesn't reduce the amount of work
to implement such settings. Please tell me I am wrong on this last point.

Regards,
Mountain
""Gary Chang[MSFT]"" wrote:
Hi Mountain,

That sample code is target at the UserScopedSettings. To use the
ApplicationScopedSettings you can manually add an app.config file (and its
values) to your project or add the application scoped values in your
project properties' setting's page.

But the application-scoped settings are read-only, in the case of the
default LocalFileSettingsProvider is used(e.g. local app.config file). So
the approach which that sample code used could not create and update the
application-scoped settings in the run-time.

Thanks!

Best regards,

Gary Chang
Microsoft Community Support
================================================== ====
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 7 '06 #3
Hi,
If I manually add an app.config file as you suggest, I assume
my app.configsections must conform to a standard structure.
Where is that structure defined? (An example would be helpful.)
You can use the VS2005 IDE's wizard to create a standard app.config. Just
right click your project node in the Solution Explorer and select
Properties, in the project's property sheet window select the "Settings"
tab, then you can add your application settings value in that tab and
VS2005 will create a corresponding app.config file automatically.
Are these the only differences between using ApplicationScopedSettings
and UserScopedSettings:
...


The main difference between them is the scope level they specified, it is
not necessary to use an app.config file for the ApplicationScopedSettings.
But it is still a general convention to use an app.config file just as in
..NET 1.1.

For the issue about the benefit from using the new ApplicationSettingsBase
with application scoped settings, the ApplicationSettingsBase class could
also works for the ApplicationScopedSettings, but those
ApplicationScopedSettings would not be updated in the run time in most
cases.

Thanks for your understanding.

Best regards,

Gary Chang
Microsoft Community Support
================================================== ====
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 10 '06 #4
The problem with your suggestion to "use the VS2005 IDE's wizard to create a
standard app.config." is that this method does not support using complex
types that are defined in the current assembly.

I am super frustrated that all these new .NET 2.0 configuration tools still
come up short. I'm left using the old .NET 1.1 approaches in most cases where
I need some relationships between elements defined in the configuration.

I would hope that there is something in the .NET 2.0 configuration that
would support what I want to do, but do far it seems this is just not the
case. These new tools only help in the simple situations. I thought MS was
committed to making sure its "easy-to-use" features would also apply to
enterprise level development. What happened to that commitment in the area of
configuration?

""Gary Chang[MSFT]"" wrote:
Hi,
If I manually add an app.config file as you suggest, I assume
my app.configsections must conform to a standard structure.
Where is that structure defined? (An example would be helpful.)


You can use the VS2005 IDE's wizard to create a standard app.config. Just
right click your project node in the Solution Explorer and select
Properties, in the project's property sheet window select the "Settings"
tab, then you can add your application settings value in that tab and
VS2005 will create a corresponding app.config file automatically.
Are these the only differences between using ApplicationScopedSettings
and UserScopedSettings:
...


The main difference between them is the scope level they specified, it is
not necessary to use an app.config file for the ApplicationScopedSettings.
But it is still a general convention to use an app.config file just as in
.NET 1.1.

For the issue about the benefit from using the new ApplicationSettingsBase
with application scoped settings, the ApplicationSettingsBase class could
also works for the ApplicationScopedSettings, but those
ApplicationScopedSettings would not be updated in the run time in most
cases.

Thanks for your understanding.

Best regards,

Gary Chang
Microsoft Community Support
================================================== ====
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 14 '06 #5
Hi,

I apologize for any inconvenience this may cause you. I will forward this
issue to our product team to review it. Hopefully we can find some way to
improve it in our next version product. Meantime, I highly suggest you can
submit this feedback to our product feedback center, our development team
may communicate with you directly on the issue there:

http://lab.msdn.microsoft.com/produc...k/default.aspx

Your feedback and concerns are of great value to us and will help in
creating products that better meet your needs.

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 17 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jonah | last post by:
Hi I've run some tests and I have to conclude that mysql and fopen doesn't work when you call it in this way. I don't understand why, it's got to be either one of 2 things: a) this just can't...
22
by: The Road To Utopia | last post by:
Here's one for the trolls...a common jibe from them is setting up audio/video hardware under linux. Ok, true story: at work today, someone asked me if I could tell him why his XP Home would play...
142
by: Herr Lucifer | last post by:
As the founder of .NET framework, Microsoft claims that it invention will be the next best platform for programming in a near future. Now it is 2005, ..NET is 5 years old, and can talk and walk for...
119
by: rhat | last post by:
I heard that beta 2 now makes ASP.NET xhtml compliant. Can anyone shed some light on what this will change and it will break stuff as converting HTML to XHTML pages DO break things. see,...
12
by: lkrubner | last post by:
Is there any reason why this code wouldn't prompt someone to save their work every 5 minutes? It doesn't seem to be working. This code shows up in the HEAD of an HTML document. function...
1
by: Lyle Fairfield | last post by:
I created a new MS-SQL Database, "TestODBC". I made Table1 and StoredProcedure1. I made an ODBC DSN for that MS-SQL Database. I created a new AccessXP mdb, "TestODBC". I linked to the...
9
by: tshad | last post by:
I have an example I copied from "programming asp.net" (o'reilly) and can't seem to get the Sub (writefile) to execute. It displays all the response.write lines that are called directly, but not...
15
by: Adam J. Schaff | last post by:
I have noticed that if a user closes a form via pressing return (either while the OK button has focus or if AcceptButton is set to OK for the form) then the "ENTER" keypress event fires ON THE...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.