Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CS0122: 'System.Configuration.StringUtil' is inaccessible due to its protection level

i am currently doing a school project whereby i can allow students and teachers to search for intership jobs.

I am trying to get to the ASP.Net Configuration to add users and roles but i got this error.

-

Server Error in '/asp.netwebadminfiles' Application.

Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0122: 'System.Configuration.StringUtil' is inaccessible due to its protection level

Source Error:

Line 987:
Line 988:             // Put together some unique app id
Line 989:             string appId = StringUtil.GetNonRandomizedHashCode(String.Concat(appPath, appPhysPath)).ToString("x", CultureInfo.InvariantCulture);
Line 990:
Line 991:

Source File: c:\Windows\Microsoft.NET\Framework64\v4.0.30319\ASP.NETWebAdminFiles\App_Code\WebAdminPage.cs Line: 989

-

Is there anyway i can fix this or do i have to redo my whole project?(hopefully not because theres alot of work done.)

I'm quite a newbie at troubleshooting so step by step guides will be greatly appreciated. thanks!

like image 271
X-men Avatar asked Aug 20 '15 11:08

X-men


2 Answers

Open the ASP.NETWebAdminFiles website using any Visual Studio

Add - Existing Website
Browse to C:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles

Inside your wesbite project, browse to the C# file

ASP.NETWebAdminFiles\App_Code\WebAdminPage.cs

Go to Line 989

Comment the line out // string appId = StringUtil.GetNonRandomizedHashCode...

Add a new line string appId = "1"

Save the website, Unload it from Visual Studio

Run IIS Express in CMD

iisexpress.exe /path:C:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles /vpath:/WebAdmin /port:8181 /clr:4.0 /ntlm

Run your website

http://localhost:8181/webadmin/default.aspx?applicationPhysicalPath=B:\TFS\MyWebsite\MyWebsiteRoot\&applicationUrl=/
like image 183
Riaan Avatar answered Sep 30 '22 08:09

Riaan


In Visual Studio

File - Open - Website

GoTo: C:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles

Open

Now open App_Code\WebAdminPage.cs

GoTo Line 989

Comment out the current text and paste

string appId = (String.Concat(appPath, appPhysPath).GetHashCode()).ToString("x", CultureInfo.InvariantCulture);

now re-try

like image 22
British_Buddha Avatar answered Sep 30 '22 06:09

British_Buddha