I need to figure out a way to add CRUD (Create, Read, Update and Delete) support for the assemblies section in the web.config file.
It may look like this
<system.web>
<compilation defaultLanguage="c#" debug="true" batch="false" targetFramework="4.0">
<assemblies>
<add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies>
</compilation>
</system.web>
I’ve tried to start with something like this
public bool AssemblyExist(string name)
{
var webConfig = new ExeConfigurationFileMap { ExeConfigFilename = GlobalSettings.FullpathToRoot + "web.config" };
var config = ConfigurationManager.OpenMappedExeConfiguration(webConfig, ConfigurationUserLevel.None);
var assemblies = config.GetSection("system.web");
// return true on match
return assemblies.ElementInformation.Properties.Keys.Equals(name);
}
But of course it fails.
So, what I’d like is an example showing how to actually fetch the values in the system.web > compilation > assemblies section!
Any advice?
There was a datatype called AssemblyInfo that where the key!
Or if using it in ubmraco
Call it like this
And to add an assembly
To call it
Cherio