简体   繁体   English

将解决方案分为多个项目

[英]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. 我用一个ASP.NET MVC 4 Internet项目(Arhi.Core)和一个用于数据的类库项目(Arhi.Data)创建了一个黑色解决方案(Arhi),在其中存储我的EDMX模型。

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. 我在Arhi.Core中添加了对Arhi.Data的引用,并尝试从Arhi.Data(人实体)添加具有Model类的Controller,但出现此错误。

'Unable to retrive metadata for 'Arhi.Core.People'. '无法检索'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.' 在配置中找不到指定的命名连接,或者不希望将其与EntityClient提供程序一起使用,或者无效。

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 ? Q2:如果我想将RDLC报告添加到解决方案中,是否还应该使用类库项目?

Connection string from Arhi.Core 来自Arhi.Core的连接字符串

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

and Arhi.Data 和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" />

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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