Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / April 2007

Tip: Looking for answers? Try searching our database.

Adding Application settings from an Add-in

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jason - 16 Apr 2007 07:40 GMT
I am developing a VS Addin-in for automated code generation and cannot figure
out how to create Application settings.

My Addin creates class objects in the current project to automate the code
needed to access and update database rows. The class objects use the
My.settings object and normally I would simply so to the settings page and
create the needed settings. Now I would like the addin to created the
my.Settings variables as part of the process but I'm unable to find any
methods to help me...

I did find the settings for the location of the Settings.Settings XML file,
updated the file with the vairiables and then do appear in the settings
dialog window but they are not recognized until I manually add/remove another
variable and save...Looks like because I'm manually manipulatng the XML file
the IDE is not happy...

I have figured out how to add references to the created project, just not
settings.. :(

I'm tryng to build a fully functioning add-in that needs no manual
intervention so any assstance would be great...

Thanks
Jason
Walter Wang [MSFT] - 16 Apr 2007 09:40 GMT
Hi Jason,

This is a quick note to let you know that I am performing research on this
issue and will get back to you as soon as possible. I appreciate your
patience.

Sincerely,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Walter Wang [MSFT] - 17 Apr 2007 12:31 GMT
Hi Jason,

The settings.settings xml file is associated with a custom tool that will
be used to generate the strong-typed My.Settings class.

Therefore your question is actually how to programmatically invoke this
custom tool if the settings xml file is changed by your code. Please feel
free to correct me if I've misunderstood anything.

To invoke the custom tool, you can use VSProjectItem.RunCustomTool
(http://msdn2.microsoft.com/en-us/library/vslangproj.vsprojectitem.runcustom
tool(VS.80).aspx). To obtain a reference of VSProjectItem of the settings
xml file, you can first get a ProjectItem
(http://msdn2.microsoft.com/en-us/library/envdte.projectitem(VS.80).aspx)
reference and cast its Object property to a VSProjectItem type.

Here's some related threads for your reference:

#Re: Generating resources.cs file
http://www.codecomments.com/message379649.html

#vstudio extensibility custom editor generated code
http://www.eggheadcafe.com/forumarchives/vstudioextensibility/Jan2006/post25
308757.asp

#How Steve Got Burned Today: December 2006
http://sstjean.blogspot.com/2006_12_01_archive.html

#MBR IT/.NET 247 : force custom tool run @build? on
microsoft.public.vsnet.ide
http://www.dotnet247.com/247reference/msgs/32/162362.aspx

Please let me know if there's anything unclear. Thanks.

Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
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.
Jason - 17 Apr 2007 15:44 GMT
Thanks Walter, Works perfectly now.. :) One line of code.. :) I like it!!!
Jason

> Hi Jason,
>
[quoted text clipped - 40 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.