问题描述
编译错误说明:在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。编译器错误消息:CS0122:“System.Configuration.StringUtil”不可访问,因为它受保护级别限制源错误:行987:行988://Puttogethersomeuniqueappid行989:stringappId=StringUtil.GetNonRandomizedHashCode(String.Concat(appPath,appPhysPath)).ToString("x",CultureInfo.InvariantCulture);行990:行991:源文件:c:WindowsMicrosoft.NETFramework64v4.0.30319ASP.NETWebAdminFilesApp_CodeWebAdminPage.cs行:989------------------------求助。这么解决,这行代码什么意思啊?
解决方案
解决方案二:
需要引用里引用System.Configuration才行
解决方案三:
请问一下这个问题你解决了么,我也遇到这个问题了....求救
解决方案四:
同求啊,昨天遇到的,今天还没有解决呢
解决方案五:
这个是啥问题啊,我也碰到了,直接安装VS2010新建项目是可以打开,配置IIS后就不行了,用的是WIN10
解决方案六:
有没有了解的大神,指点指点
解决方案七:
msdn论坛的解答,原汁原味。Forthosewhoareencounteringthe"CS0122:'System.Configuration.StringUtil'isinaccessibleduetoitsprotectionlevel"issue.It'sthefaultof.net4.6.Soyoucanuninstallthisframework(ifyouareonwindows8),forthosewhoareusingwindows10,it'sseemsdifficultorimpossibletouninstall.net4.6becauseit'sinstallwithwindows10.Sothereisanalternative,youcanmodifythec:WindowsMicrosoft.NETFramework64v4.0.30319ASP.NETWebAdminFilesApp_CodeWebAdminPage.csfilecodeorc:WindowsMicrosoft.NETFrameworkv4.0.30319ASP.NETWebAdminFilesApp_CodeWebAdminPage.cs,(dependingwhichyouaretryingtoinstall)ReplacethelinestringappId=StringUtil.GetNonRandomizedHashCode(String.Concat(appPath,appPhysPath)).ToString("x",CultureInfo.InvariantCulture);bythisone:AssemblysysConfig=Assembly.LoadFile(@"C:WindowsMicrosoft.NETFrameworkv4.0.30319System.Configuration.dll");TypesysConfigType=sysConfig.GetType("System.Configuration.StringUtil");stringappId=((int)sysConfigType.GetMethod("GetNonRandomizedHashCode").Invoke(null,newobject[]{String.Concat(appPath,appPhysPath),true})).ToString("x",CultureInfo.InvariantCulture);
解决方案八:
估计你的问题是使用asp.net配置工具产生的吧vs2012以后的版本已经没有了
解决方案九:
引用6楼wangquan628的回复:
msdn论坛的解答,原汁原味。Forthosewhoareencounteringthe"CS0122:'System.Configuration.StringUtil'isinaccessibleduetoitsprotectionlevel"issue.It'sthefaultof.net4.6.Soyoucanuninstallthisframework(ifyouareonwindows8),forthosewhoareusingwindows10,it'sseemsdifficultorimpossibletouninstall.net4.6becauseit'sinstallwithwindows10.Sothereisanalternative,youcanmodifythec:WindowsMicrosoft.NETFramework64v4.0.30319ASP.NETWebAdminFilesApp_CodeWebAdminPage.csfilecodeorc:WindowsMicrosoft.NETFrameworkv4.0.30319ASP.NETWebAdminFilesApp_CodeWebAdminPage.cs,(dependingwhichyouaretryingtoinstall)ReplacethelinestringappId=StringUtil.GetNonRandomizedHashCode(String.Concat(appPath,appPhysPath)).ToString("x",CultureInfo.InvariantCulture);bythisone:AssemblysysConfig=Assembly.LoadFile(@"C:WindowsMicrosoft.NETFrameworkv4.0.30319System.Configuration.dll");TypesysConfigType=sysConfig.GetType("System.Configuration.StringUtil");stringappId=((int)sysConfigType.GetMethod("GetNonRandomizedHashCode").Invoke(null,newobject[]{String.Concat(appPath,appPhysPath),true})).ToString("x",CultureInfo.InvariantCulture);
不行啊,这样改了之后,页面会说有错误,请返回上一级页面再试,然后按什么安全,设置选项卡都会说我超时了卸载了4.6,但4.52也帮我卸了,之后vs打不开(未知错误),现在正在重装4.5中,但重装又遇到了问题,唉唉唉,后续再报道
解决方案十:
这个问题zl解决了么?
解决方案十一:
我也遇到了同样的问题,不过当我的WIN10自动更新为TH2版本后,居然能打开了。
解决方案十二:
引用8楼sosoben的回复:
Quote: 引用6楼wangquan628的回复:
msdn论坛的解答,原汁原味。Forthosewhoareencounteringthe"CS0122:'System.Configuration.StringUtil'isinaccessibleduetoitsprotectionlevel"issue.It'sthefaultof.net4.6.Soyoucanuninstallthisframework(ifyouareonwindows8),forthosewhoareusingwindows10,it'sseemsdifficultorimpossibletouninstall.net4.6becauseit'sinstallwithwindows10.Sothereisanalternative,youcanmodifythec:WindowsMicrosoft.NETFramework64v4.0.30319ASP.NETWebAdminFilesApp_CodeWebAdminPage.csfilecodeorc:WindowsMicrosoft.NETFrameworkv4.0.30319ASP.NETWebAdminFilesApp_CodeWebAdminPage.cs,(dependingwhichyouaretryingtoinstall)ReplacethelinestringappId=StringUtil.GetNonRandomizedHashCode(String.Concat(appPath,appPhysPath)).ToString("x",CultureInfo.InvariantCulture);bythisone:AssemblysysConfig=Assembly.LoadFile(@"C:WindowsMicrosoft.NETFrameworkv4.0.30319System.Configuration.dll");TypesysConfigType=sysConfig.GetType("System.Configuration.StringUtil");stringappId=((int)sysConfigType.GetMethod("GetNonRandomizedHashCode").Invoke(null,newobject[]{String.Concat(appPath,appPhysPath),true})).ToString("x",CultureInfo.InvariantCulture);不行啊,这样改了之后,页面会说有错误,请返回上一级页面再试,然后按什么安全,设置选项卡都会说我超时了卸载了4.6,但4.52也帮我卸了,之后vs打不开(未知错误),现在正在重装4.5中,但重装又遇到了问题,唉唉唉,后续再报道
我的也是WIN10+VS2013,同样修改了代码后报错,还请高手指教,谢谢!
解决方案十三:
引用11楼wheeky的回复:
Quote: 引用8楼sosoben的回复:
Quote: 引用6楼wangquan628的回复:
msdn论坛的解答,原汁原味。Forthosewhoareencounteringthe"CS0122:'System.Configuration.StringUtil'isinaccessibleduetoitsprotectionlevel"issue.It'sthefaultof.net4.6.Soyoucanuninstallthisframework(ifyouareonwindows8),forthosewhoareusingwindows10,it'sseemsdifficultorimpossibletouninstall.net4.6becauseit'sinstallwithwindows10.Sothereisanalternative,youcanmodifythec:WindowsMicrosoft.NETFramework64v4.0.30319ASP.NETWebAdminFilesApp_CodeWebAdminPage.csfilecodeorc:WindowsMicrosoft.NETFrameworkv4.0.30319ASP.NETWebAdminFilesApp_CodeWebAdminPage.cs,(dependingwhichyouaretryingtoinstall)ReplacethelinestringappId=StringUtil.GetNonRandomizedHashCode(String.Concat(appPath,appPhysPath)).ToString("x",CultureInfo.InvariantCulture);bythisone:AssemblysysConfig=Assembly.LoadFile(@"C:WindowsMicrosoft.NETFrameworkv4.0.30319System.Configuration.dll");TypesysConfigType=sysConfig.GetType("System.Configuration.StringUtil");stringappId=((int)sysConfigType.GetMethod("GetNonRandomizedHashCode").Invoke(null,newobject[]{String.Concat(appPath,appPhysPath),true})).ToString("x",CultureInfo.InvariantCulture);不行啊,这样改了之后,页面会说有错误,请返回上一级页面再试,然后按什么安全,设置选项卡都会说我超时了卸载了4.6,但4.52也帮我卸了,之后vs打不开(未知错误),现在正在重装4.5中,但重装又遇到了问题,唉唉唉,后续再报道
我的也是WIN10+VS2013,同样修改了代码后报错,还请高手指教,谢谢!
就是4.6惹的祸。重装4.5就OK了,win10是不是自动更新4.6了啊?