简体   繁体   English

使用VS2015工具安装.NET Core 1.0(预览版)后,我无法创建.NET核心类库项目

[英]After installing .NET Core 1.0 with VS2015 tooling (preview), I am unable to create .NET core class library projects

I get this error message when I try to add a .NET core class library to my solution: 当我尝试将.NET核心类库添加到我的解决方案时,我收到此错误消息:

Error: this template attempted to load component assembly 'Microsoft.VisualStudio.ProjectSystem.DotNet.Wizard, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. 错误:此模板尝试加载组件程序集“Microsoft.VisualStudio.ProjectSystem.DotNet.Wizard,Version = 14.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a”。 For more information on this problem and how to enable this template, please see documentation on Customizing Project Templates. 有关此问题以及如何启用此模板的详细信息,请参阅有关自定义项目模板的文档。

An empty folder is created on disk but nothing is added to the solution. 在磁盘上创建一个空文件夹,但解决方案中没有添加任何内容。

My initial process consisted of: 我的初始流程包括:

  1. Upgrading Visual Studio 2015 to update 3 升级Visual Studio 2015以更新3
  2. Uninstalling the preview / rc bits of the .NET core and tooling 卸载.NET核心和工具的预览/ rc位
  3. Downloading and installing the release version of .NET core with the preview tooling 使用预览工具下载和安装.NET核心的发行版

I have tried the following after getting this error: 我收到此错误后尝试了以下内容:

  • Uninstalling and reinstalling .NET Core 卸载并重新安装.NET Core
  • Repairing .NET core installation 修复.NET核心安装
  • Uninstalling and reinstalling Visual Studio 2015 Professional w/update 3 卸载并重新安装Visual Studio 2015 Professional w / update 3
    • And then uninstalling and reinstalling and repairing .NET Core yet again afterwards for good measure 然后再卸载并重新安装和修复.NET Core,以便进行更好的测量
  • Executing devenv /setup as administrator 以管理员身份执行devenv /setup

I shut down and restart after each step as well, but no dice. 我也会在每一步之后关闭并重启,但没有骰子。

What else can I try? 我还能尝试什么? I had the preview bits of .NET Core on the machine earlier but according to the installation instructions it should be enough to just uninstall them before installing the release files, which I did. 我之前在机器上预装了.NET Core,但根据安装说明,在安装发布文件之前只需卸载它们即可。

Is there a log file somewhere which may contain information about why the assembly fail to load? 是否有某个日志文件可能包含有关程序集无法加载的原因的信息?

I have two elements in my uninstall programs list that match "Core": 我的卸载程序列表中有两个与“Core”匹配的元素:

  1. Microsoft .NET Core 1.0.0 - SDK Preview 2 (x64) Microsoft .NET Core 1.0.0 - SDK Preview 2(x64)
  2. Microsoft .NET Core 1.0.0 - VS 2015 Tooling Preview 2 Microsoft .NET Core 1.0.0 - VS 2015工具预览版2

I also have this installed, which seems to have been installed together with the above bits: 我也安装了这个,它似乎与上面的位一起安装:

  1. Microsoft .NET Version Manager (x64) 1.0.0-rc1 Microsoft .NET版本管理器(x64)1.0.0-rc1

These 3 elements are all dated as installed today. 这3个元素都是今天安装的日期。 I think the preview and rc1 parts of the name comes from the fact that only the runtime was released as final but the tooling is still in preview. 我认为名称的预览和rc1部分来自这样一个事实,即只有运行时作为最终发布,但工具仍处于预览状态。

I got the installation files from here - http://dot.net/core - so it seems to me that I should've already installed the right bits. 我从这里得到了安装文件 - http://dot.net/core - 所以在我看来我应该已经安装了正确的位。

There are no updates lingering under the Visual Studio extensions and updates. Visual Studio扩展和更新下没有任何更新。


Update 1: I did a full repair, which changed nothing. 更新1:我做了全面修复,没有任何改变。

I then tried to use the command line tool, dotnet , to create a project and that worked just fine, everything from dotnet new to dotnet run executed successfully and with the expected results. 然后我尝试使用命令行工具dotnet来创建一个项目并且工作得很好,从dotnet newdotnet run所有内容都成功执行并具有预期的结果。

I then tried copying the project.json file into a subdirectory of my existing solution, edited it to remove the entry point bit and then tried to manually add the project in VS2015, and I got this: 然后我尝试将project.json文件复制到现有解决方案的子目录中,编辑它以删除入口点位,然后尝试在VS2015中手动添加项目,我得到了这个:

The 'DNX Project System' package did not load correctly. 'DNX Project System'软件包无法正确加载。
The problem may have been caused by a configuration change or by the installation of another extension. 问题可能是由配置更改或安装另一个扩展引起的。 You can get more information by examining the file 'C:\\Users\\lasse\\AppData\\Roaming\\Microsoft\\VisualStudio\\14.0\\ActivityLog.xml'. 您可以通过检查文件'C:\\ Users \\ lasse \\ AppData \\ Roaming \\ Microsoft \\ VisualStudio \\ 14.0 \\ ActivityLog.xml'来获取更多信息。
Restarting Visual Studio could help resolve this issue. 重新启动Visual Studio可以帮助解决此问题。

The activity log it refers to can be found on my public dropbox (renamed to a .txt extension) here: ActivityLog.xml (.txt) . 它引用的活动日志可以在我的公共Dropbox(重命名为.txt扩展名)中找到: ActivityLog.xml(.txt)

Extracts from this file that may be interesting are: 此文件中可能有趣的摘录如下:

<description>Performance warning: String load failed. Pkg:{98F77210-A364-4168-BAE6-4D46FA7E19FE} (DNX Project System) LANG:0409 ID:5011&#x000D;&#x000A;</description>
<description>LegacySitePackage failed for package [DNX Project System]Source: &apos;System.ComponentModel.Composition&apos; Description: No exports were found that match the constraint: &#x000A;&#x0009;ContractName&#x0009;Microsoft.VisualStudio.Web.ProjectSystem.Telemetry.ITelemetryProvider&#x000A;&#x0009;RequiredTypeIdentity&#x0009;Microsoft.VisualStudio.Web.ProjectSystem.Telemetry.ITelemetryProvider&#x000D;&#x000A;</description>
<description>SetSite failed for package [DNX Project System](null)</description>

Update 2: I found another webpage detailing the same type of problem, only during the preview period, here: 更新2:我发现另一个网页详细说明了同一类型的问题,仅在预览期间,这里:

Cannot Create ASP.NET Core RC 2 web project in VS 2015 . 无法在VS 2015中创建ASP.NET Core RC 2 Web项目 It has a screenshot of the same error message. 它有相同错误消息的屏幕截图。

One troubleshooting step was to post the Help/About content, it is available on my public Dropbox here . 一个故障排除步骤是发布帮助/关于内容,它可以在我的公共Dropbox上找到


Update 3: OK, the website above mentions that devenv.exe.config was missing a reference to the dll in question. 更新3:好的,上面的网站提到devenv.exe.config缺少对相关dll的引用。 I checked mine and sure enough it was missing. 我检查了我的,确定它丢失了。 I did not try to manually add it yet, opting to rerun devenv /setup but now I'm noticing that this does not complete. 我没有尝试手动添加它,选择重新运行devenv /setup但现在我注意到这没有完成。

I renamed the config file first, and then reran devenv /config, it has been running for 2.5 minutes now and doesn't seem to have any motivation to complete. 我首先重命名了配置文件,然后重新命名devenv / config,它现在已经运行了2.5分钟,似乎没有任何动机要完成。


Update 4: Manually editing the config file and adding the dotnet.wizard package made Visual Studio able to create the project, but it was still not able to open it, still complaining about the DNX package. 更新4:手动编辑配置文件并添加dotnet.wizard包使Visual Studio能够创建项目,但它仍然无法打开它,仍然抱怨DNX包。

I will try some of the troubleshooting tips in that other forumthread and see if they help. 我将尝试其他论坛线程中的一些故障排除提示,看看它们是否有帮助。

I ran into a similar issue and was able to fix it by: 我遇到了类似的问题,并能够解决它:

  1. Modifying Visual Studio 2015 installation and unchecking Microsoft Web Developer Tools 修改Visual Studio 2015安装并取消选中Microsoft Web Developer Tools
  2. Deleting C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\DNX folder that was left from a previous version of the tools. 删除从以前版本的工具中删除的C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\DNX文件夹。
  3. Deleting %LocalAppData%\\Microsoft\\VisualStudio\\14.0\\ComponentModelCache 删除%LocalAppData%\\Microsoft\\VisualStudio\\14.0\\ComponentModelCache
  4. Deleting %LocalAppData%\\Microsoft\\VisualStudio\\14.0\\devenv.exe.config 删除%LocalAppData%\\Microsoft\\VisualStudio\\14.0\\devenv.exe.config
  5. Running repair on the preview2 tooling. 在preview2工具上运行修复。

安装Visual Studio Installer Projects工具对我有所帮助

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

相关问题 如何在没有安装程序的情况下卸载MS .NET Core 1.0 RC2 VS 2015工具预览版1? - How to uninstall MS .NET Core 1.0 RC2 VS 2015 Tooling Preview 1 without the installer? 安装vs2017后无法打开vs2015 .net core 1.1项目 - Unable to open vs2015 .net core 1.1 project after installing vs2017 无法安装.NET Core 1.0 Visual Studio工具预览2 - Unable to install .NET Core 1.0 Visual Studio Tooling Preview 2 安装用于.NET Core 1.0开发的VS2015工具时出错 - Errors while installing VS2015 tools for .NET Core 1.0 development 如何在安装vs2015之后在vs2015上安装Asp.Net? - How can I install Asp.Net on vs2015 after already installing vs2015 ? 安装Dot Net Core 1.0.0 VS 2015工具预览版2的问题 - Problems installing Dot Net Core 1.0.0 VS 2015 Tools Preview 2 VS2015代码覆盖率不适用于ASP.NET Core 1.0(以前称为ASP.NET 5)中的测试 - VS2015 Code Coverage not working with tests in ASP.NET Core 1.0 (formerly known as ASP.NET 5) Dot net core 1工具预览离线安装程序 - Dot net core 1 Tooling Preview offline installer VS2015解决方案中的ASP.NET CORE项目如何解决其他库引用? - How does ASP.NET CORE project in a VS2015 solution resolve other library references? 如何更改VS2015使用的.NET Core SDK版本? - How to change the .NET Core SDK version that VS2015 uses?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM