上传与EF无法Azure的问题后,加载指定的元数据资源错误 [英] Issue after uploading to azure with EF Unable to load the specified metadata resource error

查看:214
本文介绍了上传与EF无法Azure的问题后,加载指定的元数据资源错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我与ASP.net MVC5应用和EF 5型号第一种方式工作。但是也用POCO类,这是所谓的实体另一个C#项目。

I am working with ASP.net MVC5 Application and with EF 5 Model first approach. But also used poco classes, which is in another C# project called "Entity".

我有多层架构,EDMX文件在DAL层和BAL是有它,并BAL和实体项目引用主Web项目中被引用。

I am having multi-tier architecture where Edmx file is in DAL layer and BAL is having reference of it and BAL and Entity Project are referenced in main web project.

一切都运行良好,但设置数据库和项目后的天青我的网站时尝试连接它抛出下面的错误数据库MetadataException:无法加载指定的元数据资源

Everything works well but after setting up the database and project on Azure when my site tries to connect database it throws below error "MetadataException: Unable to load the specified metadata resource"

我被困在一个问题了两天,用计算器或任何其他特定的博客每一个可能的解决方案尝试。但请相信我的家伙什么工作我要出像在元DETA给人组装的完整路径,DLL。使用元数据= RES:// * /;也没有为我工作,我这里压力很大。

I am stuck in an issue for two days and tried with every possible solution given in stackoverflow or in any other blogs. But believe me guys nothing working me for out like giving the full path of assembly , dll in meta deta. using "metadata=res://*/; also didn't worked for me. I am in big stress here.

请帮助我。
在web.config中的截图和连接字符串连接。

Please help me. Screenshots and connection string in web.config is attached.

<add name="questmysqlEntities" connectionString="metadata=res://QuestCloud/QuestCloudDAL/QuestCloud.csdl|res://QuestCloud/QuestCloudDAL/QuestCloud.ssdl|res://QuestCloud/QuestCloudDAL/QuestCloud.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source******servername****;Initial Catalog=questdb;Persist Security Info=True;user id=****username****;password=****password****;MultipleActiveResultSets=True;application name=EntityFramework&quot;" providerName="System.Data.EntityClient" />

我的EDMX文件驻留在DAL(数据库层)项目和POCO模板存在于实体项目,

My Edmx file reside in DAL (Database Layer) Project and POCO Template reside in Entity project,

BAL(业务层)同时具有工程参考

BAL (Business Layer) is having reference of both Project

我的Web项目是有BAL(业务层)和实体项目引用

My Web Project is having reference of BAL (Business Layer) and Entity project

推荐答案

我得到了上述万阿英,蒋达清的解决方案。我刚才说的 QuestCloudDAL.dll 到我的主项目的 QuestCloud 的参考。同时也把这种组装的参考我的主要的web.config作为,

I got the solution of above probelm. I have just added the reference of "QuestCloudDAL.dll" into my main project QuestCloud. And also put the reference of this assembly in my main web.config as,

 <add name="questmysqlEntities" connectionString="metadata=res://QuestCloudDAL/QuestCloud.csdl|res://QuestCloudDAL/QuestCloud.ssdl|res://QuestCloudDAL/QuestCloud.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source******servername****;Initial Catalog=questdb;Persist Security Info=True;user id=****username****;password=****password****;MultipleActiveResultSets=True;application name=EntityFramework&quot;" providerName="System.Data.EntityClient" />

而不是*,我已经把 QuestCloudDAL 命名空间中we.config连接字符串的元数据资源。它按预期工作。

instead of "*", i have put "QuestCloudDAL" namespace for metadata resources in we.config connection string. And it works as expected.

这篇关于上传与EF无法Azure的问题后,加载指定的元数据资源错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆