Configuration within SharePoint 2010 Web Parts

When building SharePoint 2010 web parts, I have stumbled across the fact that there are really no easy ways to add a configuration file such as a web.config or an app.config.  So I decided to add a new project to my solution that I will eventually detach.  I expect it to build as a .DLL file and I can package it up with all of my solutions.  It will contain my connection string (with no passwords of course), also URL’s etc…

I hope to find a better way of doing this, but for now I think this is really the way to go.  You can eventually swap out .DLL’s for use when testing, or switching environments.

image

Additionally, here is another way.  You can add the configuration to the root SharePoint site’s web.config file.  Reference this link for further instructions.

If you come up with any better ways, I would like to hear about them.  For now, this is the safest way and most secure way.

Categories: SharePoint or Custom Development | Leave a comment

Post navigation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Blog at WordPress.com. Theme: Adventure Journal by Contexture International. Fonts on this blog.

Follow

Get every new post delivered to your Inbox.