ASPX页面加载C#报错
2015-12-24 16:21
543 查看
这个错误查了好久,我的Web程序之前都是可以运行的,今天突然发现不能执行了,可以正常发布,发布的web程序在服务器上也正常,只是在VS2012上无法执行,报错如下:
异常信息:
异常类型:ConfigurationErrorsException
异常消息:未能加载文件或程序集“Microsoft.CSharp, Version=4.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。未提供所需的模拟级别,或提供的模拟级别无效。(异常来自 HRESULT:0x80070542)
在System.Web.Configuration.CompilationSection.LoadAssemblyHelper(StringassemblyName, Boolean starDirective)
在System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfoai)
在System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSectioncompConfig)
在System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()
在System.Web.Compilation.BuildManager.CallPreStartInitMethods(StringpreStartInitListPath, Boolean& isRefAssemblyLoaded)
在System.Web.Compilation.BuildManager.ExecutePreAppStart()
在System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManagerappManager, IApplicationHost appHost, IConfigMapPathFactoryconfigMapPathFactory, HostingEnvironmentParametershostingParameters, PolicyLevel policyLevel, ExceptionappDomainCreationException)
未能加载文件或程序集“Microsoft.CSharp, Version=4.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。未提供所需的模拟级别,或提供的模拟级别无效。(异常来自 HRESULT:0x80070542)
在System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName,String codeBase, Evidence assemblySecurity, RuntimeAssemblylocationHint, StackCrawlMark& stackMark, IntPtrpPrivHostBinder, Boolean throwOnFileNotFound, BooleanforIntrospection, Boolean
suppressSecurityChecks)
在System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName,String codeBase, Evidence assemblySecurity, RuntimeAssemblylocationHint, StackCrawlMark& stackMark, IntPtrpPrivHostBinder, Boolean throwOnFileNotFound, BooleanforIntrospection, Boolean
suppressSecurityChecks)
在System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyNameassemblyRef, Evidence assemblySecurity, RuntimeAssemblyreqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder,Boolean throwOnFileNotFound, Boolean forIntrospection,
BooleansuppressSecurityChecks)
在System.Reflection.RuntimeAssembly.InternalLoad(StringassemblyString, Evidence assemblySecurity, StackCrawlMark&stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
在System.Reflection.RuntimeAssembly.InternalLoad(StringassemblyString, Evidence assemblySecurity, StackCrawlMark&stackMark, Boolean forIntrospection)
在System.Reflection.Assembly.Load(String assemblyString)
在System.Web.Configuration.CompilationSection.LoadAssemblyHelper(StringassemblyName, Boolean starDirective)
这是系统日志的报错信息,在网上查了很久,网友大多数给出的解决办法是:
1.检查“目标框架”与web.config配置是否一致。
2.检查引用的Microsoft.CSharp.dll是否有问题。
3.使用管理员权限启动VS。
最后我是用第三种方法解决的!很坑,搞了很久。。。。。。
异常信息:
异常类型:ConfigurationErrorsException
异常消息:未能加载文件或程序集“Microsoft.CSharp, Version=4.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。未提供所需的模拟级别,或提供的模拟级别无效。(异常来自 HRESULT:0x80070542)
在System.Web.Configuration.CompilationSection.LoadAssemblyHelper(StringassemblyName, Boolean starDirective)
在System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfoai)
在System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSectioncompConfig)
在System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()
在System.Web.Compilation.BuildManager.CallPreStartInitMethods(StringpreStartInitListPath, Boolean& isRefAssemblyLoaded)
在System.Web.Compilation.BuildManager.ExecutePreAppStart()
在System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManagerappManager, IApplicationHost appHost, IConfigMapPathFactoryconfigMapPathFactory, HostingEnvironmentParametershostingParameters, PolicyLevel policyLevel, ExceptionappDomainCreationException)
未能加载文件或程序集“Microsoft.CSharp, Version=4.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。未提供所需的模拟级别,或提供的模拟级别无效。(异常来自 HRESULT:0x80070542)
在System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName,String codeBase, Evidence assemblySecurity, RuntimeAssemblylocationHint, StackCrawlMark& stackMark, IntPtrpPrivHostBinder, Boolean throwOnFileNotFound, BooleanforIntrospection, Boolean
suppressSecurityChecks)
在System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName,String codeBase, Evidence assemblySecurity, RuntimeAssemblylocationHint, StackCrawlMark& stackMark, IntPtrpPrivHostBinder, Boolean throwOnFileNotFound, BooleanforIntrospection, Boolean
suppressSecurityChecks)
在System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyNameassemblyRef, Evidence assemblySecurity, RuntimeAssemblyreqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder,Boolean throwOnFileNotFound, Boolean forIntrospection,
BooleansuppressSecurityChecks)
在System.Reflection.RuntimeAssembly.InternalLoad(StringassemblyString, Evidence assemblySecurity, StackCrawlMark&stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
在System.Reflection.RuntimeAssembly.InternalLoad(StringassemblyString, Evidence assemblySecurity, StackCrawlMark&stackMark, Boolean forIntrospection)
在System.Reflection.Assembly.Load(String assemblyString)
在System.Web.Configuration.CompilationSection.LoadAssemblyHelper(StringassemblyName, Boolean starDirective)
这是系统日志的报错信息,在网上查了很久,网友大多数给出的解决办法是:
1.检查“目标框架”与web.config配置是否一致。
2.检查引用的Microsoft.CSharp.dll是否有问题。
3.使用管理员权限启动VS。
最后我是用第三种方法解决的!很坑,搞了很久。。。。。。
相关文章推荐
- asp.net mvc杂项收集
- 避开WebForm天坑,拥抱ASP.Net MVC吧
- asp.net WebPages 速记3
- 避开WebForm天坑,拥抱ASP.Net MVC吧
- ASP.NET html转图片
- ASP.NET 对象的使用
- asp分页技术的实现
- Resharper让我们的asp.net开发效率提高三分之一
- asp.net WebPages 速记2
- asp.net WebPages 速记1
- kali攻防第12章 Metasploit之服务器蓝屏攻击
- 盘点PHP和ASP.NET的10大对比!
- ASP.NET MVC4(Razor)从客户端中检测到有潜在危险的 Request.Form 值
- ASP.NET中最保险最环保的返回404的方法
- 盘点PHP和ASP.NET的10大对比!
- Web Frame
- ASP+Access UTF-8 网页乱码问题解决办法
- asp中遇到的几个问题——数据库连接,几个常见控件的使用问题及其解决
- ASP.NET MVC 5使用CrystalReport(水晶报表)
- Spring AOP AspectJ注解和XML配置两种实现(Maven构建)