“/asp.netwebadminfiles”应用程序中的服务器错误。

yt_xwm 2015-08-31 11:05:13
编译错误

说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。

编译器错误消息: CS0122: “System.Configuration.StringUtil”不可访问,因为它受保护级别限制

源错误:


行 987:
行 988: // Put together some unique app id
行 989: string appId = StringUtil.GetNonRandomizedHashCode(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

------------------------
求助。这么解决,这行代码什么意思啊?
...全文
1204 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
sosoben 2016-01-22
  • 打赏
  • 举报
回复
引用 11 楼 wheeky 的回复:
[quote=引用 8 楼 sosoben 的回复:] [quote=引用 6 楼 wangquan628 的回复:] msdn论坛的解答,原汁原味。 For those who are encountering the "CS0122: 'System.Configuration.StringUtil' is inaccessible due to its protection level" issue. It's the fault of .net 4.6. So you can uninstall this framework (if you are on windows 8), for those who are using windows 10, it's seems difficult or impossible to uninstall .net 4.6 because it's install with windows 10. So there is an alternative, you can modify the c:\Windows\Microsoft.NET\Framework64\v4.0.30319\ASP.NETWebAdminFiles\App_Code\WebAdminPage.cs file code or c:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles\App_Code\WebAdminPage.cs , (depending which you are trying to install) Replace the line string appId = StringUtil.GetNonRandomizedHashCode(String.Concat(appPath, appPhysPath)).ToString("x", CultureInfo.InvariantCulture); by this one : 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);
不行啊,这样改了之后,页面会说有错误,请返回上一级页面再试,然后按什么安全,设置选项卡都会说我超时了 卸载了4.6,但4.52也帮我卸了,之后vs打不开(未知错误),现在正在重装4.5中,但重装又遇到了问题,唉唉唉,后续再报道 [/quote] 我的也是WIN 10+VS2013,同样修改了代码后报错,还请高手指教,谢谢! [/quote] 就是 4.6惹的祸。重装4.5就OK了,win10是不是自动更新4.6了啊?
梦在旅途 2015-12-06
  • 打赏
  • 举报
回复
引用 8 楼 sosoben 的回复:
[quote=引用 6 楼 wangquan628 的回复:] msdn论坛的解答,原汁原味。 For those who are encountering the "CS0122: 'System.Configuration.StringUtil' is inaccessible due to its protection level" issue. It's the fault of .net 4.6. So you can uninstall this framework (if you are on windows 8), for those who are using windows 10, it's seems difficult or impossible to uninstall .net 4.6 because it's install with windows 10. So there is an alternative, you can modify the c:\Windows\Microsoft.NET\Framework64\v4.0.30319\ASP.NETWebAdminFiles\App_Code\WebAdminPage.cs file code or c:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles\App_Code\WebAdminPage.cs , (depending which you are trying to install) Replace the line string appId = StringUtil.GetNonRandomizedHashCode(String.Concat(appPath, appPhysPath)).ToString("x", CultureInfo.InvariantCulture); by this one : 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);
不行啊,这样改了之后,页面会说有错误,请返回上一级页面再试,然后按什么安全,设置选项卡都会说我超时了 卸载了4.6,但4.52也帮我卸了,之后vs打不开(未知错误),现在正在重装4.5中,但重装又遇到了问题,唉唉唉,后续再报道 [/quote] 我的也是WIN 10+VS2013,同样修改了代码后报错,还请高手指教,谢谢!
JavaZhangJs 2015-12-02
  • 打赏
  • 举报
回复
我也遇到了同样的问题,不过当我的WIN10自动更新为TH2版本后,居然能打开了。
dzqwa 2015-11-09
  • 打赏
  • 举报
回复
这个问题zl解决了么?
sosoben 2015-10-16
  • 打赏
  • 举报
回复
引用 6 楼 wangquan628 的回复:
msdn论坛的解答,原汁原味。 For those who are encountering the "CS0122: 'System.Configuration.StringUtil' is inaccessible due to its protection level" issue. It's the fault of .net 4.6. So you can uninstall this framework (if you are on windows 8), for those who are using windows 10, it's seems difficult or impossible to uninstall .net 4.6 because it's install with windows 10. So there is an alternative, you can modify the c:\Windows\Microsoft.NET\Framework64\v4.0.30319\ASP.NETWebAdminFiles\App_Code\WebAdminPage.cs file code or c:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles\App_Code\WebAdminPage.cs , (depending which you are trying to install) Replace the line string appId = StringUtil.GetNonRandomizedHashCode(String.Concat(appPath, appPhysPath)).ToString("x", CultureInfo.InvariantCulture); by this one : 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);
不行啊,这样改了之后,页面会说有错误,请返回上一级页面再试,然后按什么安全,设置选项卡都会说我超时了 卸载了4.6,但4.52也帮我卸了,之后vs打不开(未知错误),现在正在重装4.5中,但重装又遇到了问题,唉唉唉,后续再报道
wangquan628 2015-10-10
  • 打赏
  • 举报
回复
估计你的问题是使用asp.net配置工具产生的吧 vs2012以后的版本已经没有了
wangquan628 2015-10-10
  • 打赏
  • 举报
回复
msdn论坛的解答,原汁原味。 For those who are encountering the "CS0122: 'System.Configuration.StringUtil' is inaccessible due to its protection level" issue. It's the fault of .net 4.6. So you can uninstall this framework (if you are on windows 8), for those who are using windows 10, it's seems difficult or impossible to uninstall .net 4.6 because it's install with windows 10. So there is an alternative, you can modify the c:\Windows\Microsoft.NET\Framework64\v4.0.30319\ASP.NETWebAdminFiles\App_Code\WebAdminPage.cs file code or c:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles\App_Code\WebAdminPage.cs , (depending which you are trying to install) Replace the line string appId = StringUtil.GetNonRandomizedHashCode(String.Concat(appPath, appPhysPath)).ToString("x", CultureInfo.InvariantCulture); by this one : 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);
cao.peng 2015-09-19
  • 打赏
  • 举报
回复
这个是啥问题啊,我也碰到了,直接安装VS2010新建项目是可以打开,配置IIS后就不行了,用的是WIN10
cao.peng 2015-09-19
  • 打赏
  • 举报
回复
有没有了解的大神,指点指点
qq_30042133 2015-09-12
  • 打赏
  • 举报
回复
同求啊,昨天遇到的,今天还没有解决呢
愿你与天斗 2015-09-12
  • 打赏
  • 举报
回复
请问一下这个问题你解决了么 ,我也遇到这个问题了....求救
ice_baili 2015-08-31
  • 打赏
  • 举报
回复
需要引用里引用System.Configuration才行

62,234

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧