Visual Studio 2010 SP1 和无实体数据模型 (EDMX) 模板ADO.NET 实体框架 4.1
我在使用 Visual Studio 2010 SP1 和 Visual Studio 2010 SP1 的模板时遇到很多问题。 ADO.NET Entity Framework 4.1
我注意到其他人也有这些问题,并提出了类似的问题,但我认为他们没有提供足够的信息来解决这个问题。
问题:ADO.NET 实体数据模型模板没有出现
屏幕截图:http://c0848462.cdn.cloudfiles.rackspacecloud.com/f067439f6e8f25d5fd36761fd1efc88a74fd765ff1.png
解决方案文件
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "localhost", "http://localhost:36626", "{9BA46BAD-E736-4943-ACAD-EDE2E7A1A21E}"
ProjectSection(WebsiteProperties) = preProject
UseIISExpress = "true"
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0"
Debug.AspNetCompiler.VirtualPath = "/localhost_36626"
Debug.AspNetCompiler.PhysicalPath = "..\..\My Web Sites\Jantire\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_36626\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/localhost_36626"
Release.AspNetCompiler.PhysicalPath = "..\..\My Web Sites\Jantire\"
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_36626\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
SlnRelativePath = "..\..\My Web Sites\Jantire\"
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9BA46BAD-E736-4943-ACAD-EDE2E7A1A21E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9BA46BAD-E736-4943-ACAD-EDE2E7A1A21E}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
相关系统规格:
- Visual Studio 2010 Professional SP1
- ADO.NET 实体数据模型 4.1
- ASP.NET MVC 3 工具更新
- Windows 7 x64 SP1
- WebMatrix
我正在使用 WebMatrix 和 Visual Studio 2010 Professional SP1 进行编码
I'm having a lot of issues with the templates of Visual Studio 2010 SP1 & ADO.NET Entity Framework 4.1
I noticed that other people had these problems, and asked similar questions, but I don't think they gave enough information to make it solve-able.
The Problem: ADO.NET Entity Data Model Templates are not appearing whatsoever
Screenshot: http://c0848462.cdn.cloudfiles.rackspacecloud.com/f067439f6e8f25d5fd36761fd1efc88a74fd765ff1.png
Solution File
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "localhost", "http://localhost:36626", "{9BA46BAD-E736-4943-ACAD-EDE2E7A1A21E}"
ProjectSection(WebsiteProperties) = preProject
UseIISExpress = "true"
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0"
Debug.AspNetCompiler.VirtualPath = "/localhost_36626"
Debug.AspNetCompiler.PhysicalPath = "..\..\My Web Sites\Jantire\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_36626\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/localhost_36626"
Release.AspNetCompiler.PhysicalPath = "..\..\My Web Sites\Jantire\"
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_36626\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
SlnRelativePath = "..\..\My Web Sites\Jantire\"
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9BA46BAD-E736-4943-ACAD-EDE2E7A1A21E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9BA46BAD-E736-4943-ACAD-EDE2E7A1A21E}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Relevant System Specs:
- Visual Studio 2010 Professional SP1
- ADO.NET Entity Data Model 4.1
- ASP.NET MVC 3 Tools Update
- Windows 7 x64 SP1
- WebMatrix
I'm coding this using both WebMatrix and Visual Studio 2010 Professional SP1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
恢复 majidgeek 答案中建议的默认项目模板对我没有帮助(使用 Visual Studio 2012)。
也不修复 Visual Studio。
我使用了 MSDN 中的 Web 安装程序来安装 VS2012,因此我没有安装介质来应用 AH 中建议的解决方案。回答。
但是,这里接受的答案解决了我的问题:
http://www.datazx.cn/Fv7p5a/xw-US/oaax2pu/2q7xs6/d8x6rssc-b4mt-fsix-bc6c-ct8mf8d6fsbc23rsdfd.html
此外,forums.asp.net 上的“Visual Studio 2012 Express for Web 中缺少实体框架模板”威胁中接受的答案建议通过“开始 -> ”修复 Visual Studio 2012 enu 的实体框架设计器。控制面板-> “程序和功能”也可能有效(我只能发布两个具有我当前 1 分 Stackoverflow 声誉的链接,因此我不会提供确切的来源)。
另一种可能的解决方案:
http://social.msdn.microsoft.com/Forums/en-US/c059069b-eae4-48b4-a06e-ffd5f186077b/adonet-data- entity-model-template-missing-in-vs-2010-ultimate?forum=adodotnetentityframework
我还在非默认路径(不同的磁盘分区)中安装了VS,所以它确实可能是潜在原因之一问题。
Restoring default project templates proposed in the majidgeek answer did not help me (with Visual Studio 2012).
Repairing Visual Studio neither.
I had used a Web Installer from MSDN to install VS2012, so i had no installation media to apply the solution suggested in the AH. answer.
However, the accepted answer from here solved my problem:
http://www.datazx.cn/Fv7p5a/xw-US/oaax2pu/2q7xs6/d8x6rssc-b4mt-fsix-bc6c-ct8mf8d6fsbc23rsdfd.html
Also, the accepted answer in the "Missing Entity Framework Template in Visual Studio 2012 Express for Web" threat on forums.asp.net suggests that repairing Entity Framework Designer for Visual Studio 2012 enu via 'Start -> Control Panel -> Programs and Features' might work as well (I can post only two links with my current 1 point Stackoverflow reputation, so I won't provide the exact source).
Another possible solution:
http://social.msdn.microsoft.com/Forums/en-US/c059069b-eae4-48b4-a06e-ffd5f186077b/adonet-data-entity-model-template-missing-in-vs-2010-ultimate?forum=adodotnetentityframework
I also installed VS in a non-default path (different disk partition), so it indeed may be one of the potential causes of the problem.
我卸载了 VS2012 Ultimate 试用版并安装了 VS2012 Premuim 并发生了这种情况。在 Windows 7 控制面板\程序\程序和功能中,我找到了“Entity Framework Designer for Visual Studio 2012 - enu”,并进行了修复并修复了所有问题。
I had uninstalled VS2012 Ultimate trial and installed VS2012 Premuim and had this happen. In Windows 7 Control Panel\Programs\Programs and Features I found "Entity Framework Designer for Visual Studio 2012 - enu and did a repair and that fixed everything.
尝试恢复默认项目模板。
try Restore Default Project Templates.
如果您已经安装了完整的 VS 并且未出现模板,请尝试运行 VS2010 安装程序并单击“修复/重新安装”,处理完成后,重新启动系统。
if you already installed full VS and template not appears try to run VS2010 setup and and click
Repair/Reinstall
and after that processing finished,restart system.我终于能够添加模板了。我必须重新安装 EntityFramework 4.1,然后重新安装 Visual Studio 模板。步骤如下:
I was finally able to add the template. I had to reinstall the EntityFramework 4.1 and then reinstall the visual studio templates. Here are the steps:
在 C:\ProgramData\Package Cache 中搜索 EFTools.msi 并安装最新版本。
search in C:\ProgramData\Package Cache for EFTools.msi and install the latest.
打开 VS2010 的安装介质并浏览到“:\WCU\EFTools”。
您将找到两个文件:
ADONETEntityFrameworkTools_enu.msi
ADONETEntityFrameworkTools_enu.cab
包含 msi 和 cap 文件的文件夹。
运行此命令:
ADONETEntityFrameworkTools_enu.msi USING_EXUIH=1 /log "Log.txt"
安装需要一段时间,因此请耐心等待。
安装现在应该在“控制面板 -> 安装的程序”中显示为“Microsoft Visual Studio 2010 ADO.NET Entity Framework Tools”。
将新项目添加到项目时,项目模板应在 Visual Studio 中可见。 (添加新项 -> 数据 -> ADO.NET 实体数据模型)。
更多信息请参见:http://msdn.microsoft.com/en-us/library/ee225240.aspx< /a>
Open the install media for VS2010 and browse to ":\WCU\EFTools".
Her you will find two files:
ADONETEntityFrameworkTools_enu.msi
ADONETEntityFrameworkTools_enu.cab
folder with the msi and cap files.
Run this command:
ADONETEntityFrameworkTools_enu.msi USING_EXUIH=1 /log "Log.txt"
It will take a while to install so be patient.
The installation should now be visible in "Control Panel -> Installed Programs" as "Microsoft Visual Studio 2010 ADO.NET Entity Framework Tools".
The items template should be visible in Visual Studio when adding a new item to a project. (Add New Item->Data->ADO.NET Entity Data Model).
More info here: http://msdn.microsoft.com/en-us/library/ee225240.aspx
实际上,您必须添加简单的类库项目,并执行“添加新项”,然后您将找到 ADO.NET 实体数据模型。
(似乎从较新的版本开始,他们已经删除了这个项目模板,并将其作为“新项目”提供。我正在搜索它,然后发现它像新项目而不是新项目模板。尽管这个 MSDN 链接显示了 ado.net 实体数据模型作为新项目:( http://msdn.microsoft.com/en-us/data/ff830362
Actually, you will have to add simple class library project, and do "Add New Item" and then you will find ADO.NET Entity Data model.
(It seems from newer versions, they have removed this project template, and offering it as "New Item". I was searching for it, then found it like new item instead of new project template. though this MSDN link shows ado.net entity data model as new project :( http://msdn.microsoft.com/en-us/data/ff830362
安装 Visual Studio 时,有一个名为 Microsoft Visual Studio 2010 ADO.NET Entity Framework Tools 的单独组件。您只需检查已安装的程序即可检查计算机中是否安装了该组件。如果未安装该组件,您可能必须从 VS 安装介质重新安装它。
您提到您有专业版本,但我仍然希望您的“添加新项目”将包含更多功能 - 我没有看到 Windows 窗体、WPF 和工作流组 - 所有有效组。您的安装似乎不完整,或者您正在使用某些可能不提供所有组的项目模板。
安装 EF 4.1 不会添加 EF 4 中必需的部分,这些部分是 VS 安装的一部分。 EF 4.1 将这些功能作为先决条件。
When you install Visual Studio there is separate component called Microsoft Visual Studio 2010 ADO.NET Entity Framework Tools. You can check that this component is installed in your computer simply by checking installed programs. If the component is not installed you must probably install it again from VS intallation media.
You mentioned that you have a Professional version but still I would expect that your Add New Item will contain much more features - I don't see groups for Windows Forms, WPF and Workflow - all valid groups. It looks like your installation is somehow incomplete or you are using some project template that perhaps don't offer all groups.
Installing EF 4.1 will not add necessary parts from EF 4 which are part of VS installation. EF 4.1 has these features as prerequisity.
我的解决方案是我的全新项目在项目设置中莫名其妙地设置为使用.NET 2.0。一旦我将其设置为 4.5,模板就会出现。
My solution was that my brand new project was inexplicably set to use .NET 2.0 in the project settings. Once I set it to 4.5, the template appeared.
该模板可以从以下链接下载。
microsoft.com ADO.net 4.1 下载
The template could be downloaded from the following link.
microsoft.com ADO.net 4.1 download