• IIS网站部署后,程序常见错误记录


    1、网站部署步骤

    开启IIS服务、打开IIS管理器、添加网站、修改程序池(4.0)、部署完成。

    2、常见问题记录(问题记录比较模糊,仅做参考)

    (1)、对于web.config连接数据库的配置为windows身份验证,登录时(实际就是访问数据库时)会报这个错。

    1 <connectionStrings>
    2 <add name="fxszEntities1" connectionString="metadata=res://*/fxsz.csdl|res://*/fxsz.ssdl|res://*/fxsz.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=fxsz;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
    3 </connectionStrings>
    4 <!--<connectionStrings>
    5 <add name="fxszEntities1" connectionString="metadata=res://*/fxsz.csdl|res://*/fxsz.ssdl|res://*/fxsz.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=fxsz;user id=sa;password=sa;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
    6 </connectionStrings>-->
    7 </span></div>
    config配置
    问题图
    Picture

    解决方法:把程序池里的标识改为LocalSystem即可

    (2)未能加载文件或程序集“Zephyr.Web”或它的某一个依赖项。试图加载格式不正确的程序

    Picture

    异常详细信息: System.BadImageFormatException: 未能加载文件或程序集“Zephyr.Web”或它的某一个依赖项。试图加载格式不正确的程序。

    原因分析:操作系统是64位的,但发布的程序引用了一些32位的ddl,所以出现了兼容性的问题。 
    解决方案:IIS——应用程序池——高级设置——启用32位应用程序 :true。

  • 相关阅读:
    C#中常见的系统内置委托用法详解(抄录)
    ClassifyHandler 分类处理结构
    AutoFac Ioc依赖注入容器
    深入理解DIP、IoC、DI以及IoC容器
    ASP.NET MVC的请求处理流程
    电商秒杀功能实现
    MVC之Global.asax解析
    MVC基类控制器的会话丢失重新登录权限过滤
    MVC的Action上下文:ActionExecutingContext
    ASP.NET与MVC架构区别总结
  • 原文地址:https://www.cnblogs.com/dh123/p/9999224.html
Copyright © 2020-2023  润新知