Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
497 views
in Technique[技术] by (71.8m points)

c# - 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:WindowsMicrosoft.NETFramework64v4.0.30319ASP.NETWebAdminFilesApp_CodeWebAdminPage.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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Open the ASP.NETWebAdminFiles website using any Visual Studio

Add - Existing Website
Browse to C:WindowsMicrosoft.NETFrameworkv4.0.30319ASP.NETWebAdminFiles

Inside your wesbite project, browse to the C# file

ASP.NETWebAdminFilesApp_CodeWebAdminPage.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:WindowsMicrosoft.NETFrameworkv4.0.30319ASP.NETWebAdminFiles /vpath:/WebAdmin /port:8181 /clr:4.0 /ntlm

Run your website

http://localhost:8181/webadmin/default.aspx?applicationPhysicalPath=B:TFSMyWebsiteMyWebsiteRoot&applicationUrl=/

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...