本地运行都正常,就是发布到服务器上不行,查找了一些文章,都没解决我的问题,后来发现是路径不对和文件缺失。

原来的配置文件中是这样的:

<add name="TRidentityEntities" connectionString="metadata=res://*/TRidentityModel.csdl|res://*/TRidentityModel.ssdl|res://*/TRidentityModel.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=localhost;user id=root;password=xxxxxx;persistsecurityinfo=True;database=xxxxxx;Character Set=utf8&quot;" providerName="System.Data.EntityClient" />

修改一下:

<add name="TRidentityEntities" connectionString="metadata=~/bin/TRidentityDB\TRidentityModel.csdl|~/bin/TRidentityDB\TRidentityModel.ssdl|~/bin/TRidentityDB\TRidentityModel.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=localhost;user id=root;password=xxxxxx;database=xxxxxx;Character Set=utf8&quot;" providerName="System.Data.EntityClient" />

.csdl/.ssdl/.msl这三个文件你编译的时候会在你项目的bin目录中,copy过来就行了。

Unable to load the specified metadata resource的更多相关文章

  1. EF + mysql 异常:Unable to load the specified metadata resource

    数据库连接字符串报错, <add name="xxxx" providerName="MySql.Data.MySqlClient" connection ...

  2. jenkins 启动slave,出现com.sun.deploy.net.FailedDownloadException: Unable to load resource: http://127.0.0.1:8080/jnlpJars/remoting.jar

    master: linux slave: win7 64位系统 在配置好系统后,采用jnlp的方式启动slave节点,报错如下: com.sun.deploy.net.FailedDownloadEx ...

  3. 【转】Unable to load embedded resource from assembly 无法加载的程序集嵌入的资源

    转自:http://blog.sina.com.cn/s/blog_994678b90101f035.html 项目运用IbatisNet 今天更新项目,编译完点击运行,报错如下: [“/”应用程序中 ...

  4. LM-Sensors unable to load driver module

    Fix - sort of - for LM-Sensors unable to load driver module In short: In /etc/default/grub set GRUB_ ...

  5. Unable to load configuration. - bean - jar: ....struts2-core-2.1.8.1.jar!/struts-default.xml:47:178

    摘录的异常代码: 2013-12-14 22:42:07 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error严重: Dis ...

  6. 版本问题 Java:Unsupported major.minor version 51.0 (unable to load class . . .

    导入别人的项目时报错  Java:Unsupported major.minor version 51.0 (unable to load class . . . 后发现错误是由于class编译器的J ...

  7. (办公)plug-in org.eclipse.jdt.ui was unable to load class org.eclipse.jdt.internal

    今天上午开发环境遇到这个问题,解决方案如下,(解决了之后,项目并没有丢失.) 因为Eclipse的这个plug-in org.eclipse.jdt.ui was unable to load cla ...

  8. Unable to load tag handler class "com.showId.Id.ShowId" for tag "ShowId:ShowId"] with root cause错误的解决方案

     严重: Servlet.service() for servlet [jsp] in context with path [/Biaoqian] threw exception [/1.jsp (l ...

  9. Caused by: Unable to load configuration. - action - file:/C:/apache-tomcat-7.0.70/webapps/Structs/WEB-INF/classes/struts.xml:7:72 at com.opensymphony.xwork2.config.ConfigurationManager.getConfigurati

    Unable to load configuration. - action - file:/C:/apache-tomcat-7.0.70/webapps/Structs/WEB-INF/class ...

随机推荐

  1. No Desktop License Servers available to provide a license

    远程桌面连接失败,提示:“no Remote Desktop License Servers available to provide a license” 原因:没有remote desktop l ...

  2. Flutter移动电商实战 --(10)使用FlutterSwiper制作轮播效果

    1.引入flutter_swiper插件 flutter最强大的siwiper, 多种布局方式,无限轮播,Android和IOS双端适配. 好牛X得介绍,一般敢用“最”的一般都是神级大神,看到这个介绍 ...

  3. CSS3 新特性

    ~平时喜欢逛博客,看别人的学习总结和遇到的问题解决办法,恰好最近在做书签整理,翻到了之前一个前辈移动前端的总结,所以我就按他的总结模块对自己的知识进行了梳理,不过由于都是手写的,为了方便,下面的都是平 ...

  4. UML建模综述

    一.概念 UML-Unified Model Language 统一建模语言,又称标准建模语言.是用来对软件密集系统进行可视化建模的一种语言.作为一个支持模型化和软件系统开发的图形化语言,UML为软件 ...

  5. usage memcache in linux

    set和add的区别 set可以重写存在的键值对, 也可以添加新的/ 而add不行, 如果存在已有的键名, 则add不会做更新该键值对, 不做任何事, 就是一次无效操作, 也就是, add可以防止重写 ...

  6. 解决docker命令行终端显示不全的问题

    访问docker容器,vim编辑文件时总是无法展示文件内容 解决 sudo docker exec -it -e LINES=$(tput lines) -e COLUMNS=$(tput cols) ...

  7. an extra named object property

    Grunt supports the ability to split each task configuration into several separate configurations all ...

  8. centos6 安装tensorflow

    1.升级python2.6.6 至 python2.7.12+ 升级时./configure --prefix=/usr/local/python27 --enable-unicode=ucs4 2. ...

  9. IPv6 ping命令

    IPv6 ping命令 一.Linux操作系统 给一台 Linux 主机分配了一个 IPv6 的 IP地址,如何使用 ping命令 确定该 IP地址 能否 ping 通呢? 1.查看主机的 IPv6 ...

  10. Spring策略模式的实现

    场景: 有时候一个业务方法有多个实现类,需要根据特定的情形进行业务处理. 例如:商店支付,我们可以使用支付宝.微信扫描农行.xxx行的快捷支付(而不是微信支付.支付宝支付二维码)购买商品. 实现代码( ...