简体   繁体   中英

Splitting an Solution into multiple projects

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" />

如果两个数据库不同,则在第一个连接字符串中没有用户名和密码,然后在第一个连接字符串中提供用户名和密码

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM