Splitting an Solution into multiple projects

偶尔善良 提交于 2020-01-06 07:56:45

问题


I created a Black Solution (Arhi) with a ASP.NET MVC 4 Internet project (Arhi.Core) and Class library project for data (Arhi.Data) where I'm storing my EDMX Model.

I added a reference for Arhi.Data into Arhi.Core and I tried to add a Controller with a Model class from Arhi.Data (People entity) and I got this error.

'Unable to retrive metadata for 'Arhi.Core.People'. The specified named connection is either not found in the configuration, not inteneded to be used with the EntityClient provider, or not valid.'

Q : Why did I get this error ? Is my approach wrong / any recommendations? Q2 : If I want to add RDLC reports to my solution, should I also use a Class Library project ?

Connection string from Arhi.Core

<add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-SalvamontMVC-20121108140556;Integrated Security=SSPI" />

and Arhi.Data

<add name="SalvamontEntities" connectionString="metadata=res://*/ModelSalva.csdl|res://*/ModelSalva.ssdl|res://*/ModelSalva.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=www.arhimedes.ro,1433;initial catalog=Salvamont;persist security info=True;user id=sa;password=********;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

回答1:


in your first connection string not have user name and password if two database deference then give user name and password in first connection string



来源:https://stackoverflow.com/questions/13290973/splitting-an-solution-into-multiple-projects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!