Unable to load the specified metadata resource
本地运行都正常,就是发布到服务器上不行,查找了一些文章,都没解决我的问题,后来发现是路径不对和文件缺失。
原来的配置文件中是这样的:
<add name="TRidentityEntities" connectionString="metadata=res://*/TRidentityModel.csdl|res://*/TRidentityModel.ssdl|res://*/TRidentityModel.msl;provider=MySql.Data.MySqlClient;provider connection string="server=localhost;user id=root;password=xxxxxx;persistsecurityinfo=True;database=xxxxxx;Character Set=utf8"" 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="server=localhost;user id=root;password=xxxxxx;database=xxxxxx;Character Set=utf8"" providerName="System.Data.EntityClient" />
.csdl/.ssdl/.msl这三个文件你编译的时候会在你项目的bin目录中,copy过来就行了。
最新文章
- Eclipse引入外部Jar在发布时没有自动带入,导致出现ClassNoFound错误
- BZOJ 2002 [Hnoi2010]Bounce 弹飞绵羊 ——Link-Cut Tree
- Open Live Writer的配置
- php学习第一讲----php是什么?
- Python+Selenium进行UI自动化测试项目中,常用的小技巧2:读取配置文件(configparser,.ini文件)
- Spring配置JNDI的解决方案
- 账户切换[转自vbird]
- Discussing the scenery in the program of 863 with Doctor Zhang!
- 通过I2C总线向EEPROM中写入数据,记录开机次数
- 解决websphere在aix linux下日志乱码
- Android code wiki
- Linux下安装McAfee防病毒软件(企业版本)
- 《windows核心编程系列》二谈谈ANSI和Unicode字符集 .
- JSON.parse这个是啥?
- java遍历Set集合
- Vijos 1040 高精度乘法
- java之生成可重复执行的sql脚本
- live-server 介绍&;安装
- 【XSY2741】网格 分治 LCT 并查集
- 关于Retrofit网络请求URL中含有可变参数的处理
热门文章
- Flutter制作Toast会自己关闭的消息提示框
- 使用 usb 调试的时候,连接上电脑没反应
- python练习-(秒转时分秒,时分秒转秒)-对比linux中文件的上次更改时间跟当前时间相差多久。
- Python——sklearn提供的自带的数据集
- 【SQL】 java.sql.SQLException: You can&#39;t specify target table &#39;emp&#39; for update in FROM clause
- 自动化测试 | 好用的自动化测试工具Top 10
- spring clound gateway 上传文件,中文文件名乱码解决办法
- Win10+VS2017配置pthread
- SQL中group by后面的having中不能使用别名
- Java内部类(4):静态内部类&;接口内部类