This is where Duplicacy comes in – it’s fast, efficient and secure, available for Linux, OSX and Windows and the command line version is free for personal use. Unfortunately, most control panels can’t use this sort of cloud storage they expect to backup by SFTP rather than S3 or WebDAV. The rest of this post assumes you will use that, but other cloud providers can also be used – there is a slightly different process for using Wasabi, for example. To set them up you’ll obviously need somewhere to store them, and the good news is if you have a Microsoft 365 subscription you already have 1 TB of free OneDrive storage that is probably largely unused.
The good thing is that you don't have to chage your code behind approach for getting these values.Ĭommon.Config for Class Library/Common configuration Ĭode behind string configValue = ConfigurationSettings.The best backups are automated (hence frequent), versioned (so you can recover from deleted or hacked files) and off-site (no worries about natural disasters or the host going bust).But remember that key should not be available in the nfig other wise the value which is available in the nfig will be picked up. If you want to use same Key with Different values as per the application, then use same key and the diff values in wen.config and app.config.Window Application specific configuration can be mentioned in app.config.Website specific configuration can be stored in web.config.Class library will be getting always one value for web as well as windows application. Repository and can be stored in external XML file. Common Configuration can be defined as a single.With the help of below mentioned code you can achieve the followings and play with the configuration as you want. I have searched a lot for the complete solution but always getting the concepts and small piece of code, that's why i am providing the complete working code. I have implemented the configuration as per my requirement. Thanks to Bob Horn and JoeBilly for valuable inputs. But it is not working for me.Ĭode Behind: Configuration config = ConfigurationManager.OpenExeConfiguration("D:\\")
I am using the following code to get the configuration from the external location from window and web application. This is to reduce the duplicacy/conflicts of same configurations in multiple apps. web.config in website or app.config in windows application. I am able to access the same class library in window application.īut, How do i Share the Web.config file of website with the Window Application? So that, i don't have to replicate the same configuration.įurther detail on Question 1: I would like to add config file in Class Library instead of having dependent on application's config file. Now, I want to access the same component and configuration in a Window Application (C# VS-2k8). Web.config having some configuration values, which is used by the Class Library. Website accessing the class library successfully.
I have created a Class Library (Core Processing Component) using C# in Visual Studio 2008 and added the reference in Website.