CS0122:“System.Configuration.StringUtil"由于其保护级别而无法访问 [英] CS0122: 'System.Configuration.StringUtil' is inaccessible due to its protection level
问题描述
我目前正在做一个学校项目,我可以让学生和老师寻找实习工作.
我正在尝试进入 ASP.Net 配置以添加用户和角色,但出现此错误.
-
<块引用>/asp.netwebadminfiles"应用程序中的服务器错误.
编译错误说明:编译过程中发生错误为该请求提供服务所需的资源的编译.请查看以下特定错误详细信息并修改您的来源适当地编码.
编译器错误消息:CS0122:System.Configuration.StringUtil"是由于其保护级别而无法访问
源错误:
第 987 行:第 988 行://组合一些唯一的应用程序 ID第 989 行:字符串 appId = StringUtil.GetNonRandomizedHashCode(String.Concat(appPath, appPhysPath)).ToString("x", CultureInfo.InvariantCulture);第 990 行:第 991 行:
<块引用>
源文件:c:WindowsMicrosoft.NETFramework64v4.0.30319ASP.NETWebAdminFilesApp_CodeWebAdminPage.cs线路:989
-
无论如何我可以解决这个问题还是我必须重做我的整个项目?(希望不是因为完成了很多工作.)
我是故障排除方面的新手,因此将不胜感激分步指南.谢谢!
使用任何 Visual Studio 打开 ASP.NETWebAdminFiles 网站
添加 - 现有网站浏览到 C:WindowsMicrosoft.NETFrameworkv4.0.30319ASP.NETWebAdminFiles
在您的 wesbite 项目中,浏览到 C# 文件
<块引用>ASP.NETWebAdminFilesApp_CodeWebAdminPage.cs
转到第 989 行
注释掉//string appId = StringUtil.GetNonRandomizedHashCode...
新增一行 string appId = "1"
保存网站,从 Visual Studio 中卸载
在 CMD 中运行 IIS Express
iisexpress.exe/path:C:WindowsMicrosoft.NETFrameworkv4.0.30319ASP.NETWebAdminFiles/vpath:/WebAdmin/port:8181/clr:4.0/ntlm
运行您的网站
http://localhost:8181/webadmin/default.aspx?applicationPhysicalPath=B:TFSMyWebsiteMyWebsiteRoot&applicationUrl=/
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!
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=/
这篇关于CS0122:“System.Configuration.StringUtil"由于其保护级别而无法访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!