将一个解决方案拆分为多个项目 [英] Splitting an Solution into multiple projects

查看:72
本文介绍了将一个解决方案拆分为多个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 ASP.NET MVC 4 Internet 项目 (Arhi.Core) 和用于存储我的 EDMX 模型的数据类库项目 (Arhi.Data) 创建了一个黑色解决方案 (Arhi).

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.

我在 Arhi.Core 中添加了对 Arhi.Data 的引用,并尝试从 Arhi.Data(人员实体)添加一个带有 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.

'无法检索'Arhi.Core.People' 的元数据.指定的命名连接要么在配置中找不到,要么旨在与 EntityClient 提供程序一起使用,否则无效.'

'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.'

:为什么我会收到这个错误?我的方法是错误的/有什么建议吗?Q2:如果我想将 RDLC 报告添加到我的解决方案中,我还应该使用类库项目吗?

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 ?

来自 Arhi.Core 的连接字符串

Connection string from Arhi.Core

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

和 Arhi.Data

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

推荐答案

如果两个数据库不同,则在你的第一个连接字符串中没有用户名和密码,则在第一个连接字符串中给出用户名和密码

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

这篇关于将一个解决方案拆分为多个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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