CS0122:'System.Configuration.StringUtil'不可访问由于其保护级别 [英] CS0122: 'System.Configuration.StringUtil' is inaccessible due to its protection level

查看:1142
本文介绍了CS0122:'System.Configuration.StringUtil'不可访问由于其保护级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在做一个学校项目,由此我可以让学生和教师寻找实习生的工作。

我试图去的ASP.Net配置添加用户和角色,但我得到这个错误。

-


  

在服务器错误/asp.netwebadminfiles应用程序。


  
  

编译错误说明:在发生错误
  一个资源编译需要此请求提供服务。请
  检查下列特定错误详细信息并修改源
  code正确。


  
  

编译器错误信息:CS0122:'System.Configuration.StringUtil'是
  人迹罕至,由于其保护级别


源错误:

  987线:
行988://把一些独特的应用程序ID
989线:字符串的appid = StringUtil.GetNonRandomizedHash code(String.Concat(APPPATH,appPhysPath))的ToString(X,CultureInfo.InvariantCulture)。
990线:
991线:


  

源文件:
  C:\\ WINDOWS \\ Microsoft.NET \\ Framework64 \\ v4.0.30319 \\ ASP.NETWebAdminFiles \\ APP_ code \\ WebAdminPage.cs
  行:989


-

反正我有可以解决此问题还是我必须重做我的整个项目?(希望不是因为大量的工作做的孤单。)

我在解决问题的进度新手,所以一步一步的指导将大大AP preciated。谢谢!


解决方案

打开任何使用Visual Studio中ASP.NETWebAdminFiles网站

 添加 - 现有的网站
浏览到C:\\ WINDOWS \\ Microsoft.NET \\框架\\ v4.0.30319 \\ ASP.NETWebAdminFiles

在您的wesbite项目,浏览到C#文件


  

ASP.NETWebAdminFiles \\ APP_ code \\ WebAdminPage.cs


转到 989线

注释的行了 //字符串的appid = StringUtil.GetNonRandomizedHash code ...

添加新行字符串的appid =1

保存的网站,从Visual Studio卸载它。

在CMD运行IIS防爆preSS

  iisex press.exe /path:C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\ASP.NETWebAdminFiles / VPATH:/ WebAdmin的/端口:8181 / CLR:4.0 / NTLM

运行自己的网站

<$p$p><$c$c>http://localhost:8181/webadmin/default.aspx?applicationPhysicalPath=B:\\TFS\\MyWebsite\\MyWebsiteRoot\\&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:\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!

解决方案

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=/

这篇关于CS0122:'System.Configuration.StringUtil'不可访问由于其保护级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆