Below you will find pages that utilize the taxonomy term “app.config”
Posts
Run web.config-dependant code in PowerShell
PowerShell is a great tool. It helps in SharePoint administration and tasks automation. Today I needed to provision a webpart on many similar pages. This third-party webpart’s constructor instantiates a dataaccess service and uses a connectionstring which is stored in the web.config file. So the webpart creation failed until I found a way to load the configuration into powershell. First you can create a simple file powershell.exe.config, put it into $pshome (C:\Windows\System32\WindowsPowerShell\v1.
Posts
Ändra properties i efterhand
Ibland ändras vissa variabler. Man vill så klart inte kompilera varje gång man ändrar ApplicationName eller connectionString. I mitt förra inlägg har jag visat hur man använder app.config, hur man lägger till ett värde och hur man hämtar det i programmet. Nu vill jag visa hur man ändrar det efter kompileringen. I mappen var projektet finns gå in på bin -> Debug. Där finns både .exe-filen och en fil som heter samma som .
Posts
app.config
app.config kan användas till mycket. Här är ett litet exempel hur man använder den. Så kan app.config se ut:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="ApplicationName" value="SharePoint - 80" /> </appSettings> </configuration> ```Sedan i programmet måste vi importera: using System.Configuration
appName = ConfigurationSettings .AppSettings[“ApplicationName”] .ToString();
## Comments from Wordpress.com #### [Ändra properties i efterhand « Sharepoint. Huvudvärk och smärtstillande.](http://sharepointheadache.wordpress.com/2010/10/31/andra-properties-i-efterhand/ "") - <time datetime="2010-10-31 23:12:43">Oct 0, 2010</time> \[...\] Man vill så klart inte kompilera varje gång man ändrar ApplicationName eller connectionString.