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

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

<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过来就行了。

最新文章

  1. Eclipse引入外部Jar在发布时没有自动带入,导致出现ClassNoFound错误
  2. BZOJ 2002 [Hnoi2010]Bounce 弹飞绵羊 ——Link-Cut Tree
  3. Open Live Writer的配置
  4. php学习第一讲----php是什么?
  5. Python+Selenium进行UI自动化测试项目中,常用的小技巧2:读取配置文件(configparser,.ini文件)
  6. Spring配置JNDI的解决方案
  7. 账户切换[转自vbird]
  8. Discussing the scenery in the program of 863 with Doctor Zhang!
  9. 通过I2C总线向EEPROM中写入数据,记录开机次数
  10. 解决websphere在aix linux下日志乱码
  11. Android code wiki
  12. Linux下安装McAfee防病毒软件(企业版本)
  13. 《windows核心编程系列》二谈谈ANSI和Unicode字符集 .
  14. JSON.parse这个是啥?
  15. java遍历Set集合
  16. Vijos 1040 高精度乘法
  17. java之生成可重复执行的sql脚本
  18. live-server 介绍&amp;安装
  19. 【XSY2741】网格 分治 LCT 并查集
  20. 关于Retrofit网络请求URL中含有可变参数的处理

热门文章

  1. Flutter制作Toast会自己关闭的消息提示框
  2. 使用 usb 调试的时候,连接上电脑没反应
  3. python练习-(秒转时分秒,时分秒转秒)-对比linux中文件的上次更改时间跟当前时间相差多久。
  4. Python——sklearn提供的自带的数据集
  5. 【SQL】 java.sql.SQLException: You can&#39;t specify target table &#39;emp&#39; for update in FROM clause
  6. 自动化测试 | 好用的自动化测试工具Top 10
  7. spring clound gateway 上传文件,中文文件名乱码解决办法
  8. Win10+VS2017配置pthread
  9. SQL中group by后面的having中不能使用别名
  10. Java内部类(4):静态内部类&amp;接口内部类