I found the answer in this post in a comment from Mr_Coinche.
For those who encounter "CS0122:" System.Configuration.StringUtil "is unavailable due to its level of protection." This is a .net 4.6 error.
So, you can remove this framework (if you are on windows 8), for those who use windows 10, it seems difficult or impossible to remove .net 4.6 because it is installed with windows 10.
So there is an alternative, you can change
C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ ASP.NETWebAdminFiles \ App_Code \ WebAdminPage.cs file or
C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ ASP.NETWebAdminFiles \ App_Code \ WebAdminPage.cs, (depending on what you are trying to install)
Replace string
string appId = StringUtil.GetNonRandomizedHashCode(String.Concat(appPath, appPhysPath)).ToString("x", CultureInfo.InvariantCulture);
with these lines:
Assembly sysConfig = Assembly.LoadFile(@"C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Configuration.dll"); Type sysConfigType = sysConfig.GetType("System.Configuration.StringUtil"); string appId = ((int)sysConfigType.GetMethod("GetNonRandomizedHashCode") .Invoke(null, new object[] { String.Concat(appPath, appPhysPath), true })) .ToString("x", CultureInfo.InvariantCulture);
Also, make sure you run Notepad (or any code editor that you choose) as an administrator, otherwise you will not have permission to save the file after making the changes. I made changes to both files - this is just another way of calling the same method, but in a way that matches its new level of protection in .NET 4.6
Sandra
source share