core icon indicating copy to clipboard operation
core copied to clipboard

Error creating new .NET core project in Visual Studio

Open Seany84 opened this issue 10 years ago • 7 comments

I downloaded and installed Visual Studio Update 3 and .NET Core 1.0 for Visual Studio. I restarted my machine as instructed by the prompts. Anytime I try to create any of the .NET core projects from VS I get the error dialog:

The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

Here is the last few nodes from my ActivityLog:

  <entry>
    <record>736</record>
    <time>2016/07/02 21:54:33.961</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Leaving function VBDispatch::GetTypeLib</description>
    <guid>{80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2}</guid>
  </entry>
  <entry>
    <record>737</record>
    <time>2016/07/02 21:54:33.961</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>End package load [Microsoft.VisualStudio.PlatformUI.SolutionNavigatorPackage]</description>
    <guid>{CF6A5C16-83B0-4D04-B702-195C35C6E887}</guid>
  </entry>
  <entry>
    <record>738</record>
    <time>2016/07/02 21:54:34.023</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Entering function VBDispatch::GetTypeLib</description>
  </entry>
  <entry>
    <record>739</record>
    <time>2016/07/02 21:54:34.023</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Leaving function VBDispatch::GetTypeLib</description>
    <guid>{80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2}</guid>
  </entry>
  <entry>
    <record>740</record>
    <time>2016/07/02 21:54:34.148</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Entering function CVsPackageInfo::HrInstantiatePackage</description>
    <guid>{5F2E5E42-4192-4D79-A0D8-1D881E808829}</guid>
  </entry>
  <entry>
    <record>741</record>
    <time>2016/07/02 21:54:34.148</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Begin package load [ProviderPackage]</description>
    <guid>{5F2E5E42-4192-4D79-A0D8-1D881E808829}</guid>
  </entry>
  <entry>
    <record>742</record>
    <time>2016/07/02 21:54:34.258</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>End package load [ProviderPackage]</description>
    <guid>{5F2E5E42-4192-4D79-A0D8-1D881E808829}</guid>
  </entry>
  <entry>
    <record>743</record>
    <time>2016/07/02 21:54:34.620</time>
    <type>Error</type>
    <source>SccDisplayInformation.SolutionOptions</source>
    <description>Unable to load solution user option &apos;SccProvider.Solution.LoadCount&apos;</description>
  </entry>

Seany84 avatar Jul 02 '16 21:07 Seany84

When I added the XML node as described in the article:

<dependentAssembly> 
    <assemblyIdentity name="Microsoft.VisualStudio.ProjectSystem.DotNet.Wizard" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> 
    <codeBase version="14.0.0.0" href="C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\DotNet\ProjectSystem\Microsoft.VisualStudio.ProjectSystem.DotNet.Wizard.dll"/>
</dependentAssembly>

It allowed me to create the project and it populates the solution explorer with files, however Visual Studio hangs and I need to kill it via Task Manager.

When I viewed the ActvityLog.xml it said that the DLL was missing:

  <entry>
    <record>803</record>
    <time>2016/07/04 20:01:23.515</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Begin package load [Project K Project System]</description>
    <guid>{98F77210-A364-4168-BAE6-4D46FA7E19FE}</guid>
  </entry>
  <entry>
    <record>804</record>
    <time>2016/07/04 20:01:23.515</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>CreateInstance failed for package [Project K Project System]Source: &apos;mscorlib&apos; Description: Could not load file or assembly &apos;file:///C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\ProjectK\Microsoft.VisualStudio.Web.ProjectSystem.dll&apos; or one of its dependencies. The system cannot find the file specified.&#x000D;&#x000A;System.IO.FileNotFoundException: Could not load file or assembly &apos;file:///C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\ProjectK\Microsoft.VisualStudio.Web.ProjectSystem.dll&apos; or one of its dependencies. The system cannot find the file specified.&#x000D;&#x000A;File name: &apos;file:///C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\ProjectK\Microsoft.VisualStudio.Web.ProjectSystem.dll&apos;&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark&amp; stackMark)&#x000D;&#x000A;   at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence securityEvidence)&#x000D;&#x000A;   at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)&#x000D;&#x000A;   at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)&#x000D;&#x000A;&#x000D;&#x000A;WRN: Assembly binding logging is turned OFF.&#x000D;&#x000A;To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.&#x000D;&#x000A;Note: There is some performance penalty associated with assembly bind failure logging.&#x000D;&#x000A;To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].&#x000D;&#x000A;</description>
    <guid>{98F77210-A364-4168-BAE6-4D46FA7E19FE}</guid>
    <hr>80004005 - E_FAIL</hr>
  </entry>
</activity>

This is a list of the files in C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Project

  • Microsoft.Azure.ActiveDirectory.GraphClient.FirstParty.dll
  • Microsoft.Data.Edm.dll
  • Microsoft.Data.OData.dll
  • Microsoft.Data.Services.Client.dll
  • Microsoft.VisualStudio.Web.AzureAD.Contracts.dll
  • Microsoft.VisualStudio.Web.Project.dll
  • Microsoft.VisualStudio.Web.Project.pkgdef
  • Microsoft.VisualStudio.Web.ProjectCreation.Contracts.dll
  • System.Spatial.dll

I have tried uninstalling and re-installing the DotNetCorev1.0.0VS2015ToolsPreview2.

Does anyone have any ideas how I can resolve this issue ?

Seany84 avatar Jul 04 '16 20:07 Seany84

@barrytang @Pilchie

Petermarcu avatar Jul 05 '16 19:07 Petermarcu

@Petermarcu @barrytang @Pilchie Does anyone have any idea how I could attempt to fix this or is there anything I can provide you with?

Seany84 avatar Jul 11 '16 22:07 Seany84

@Seany84 we had other reports of similar issues -- see here and here. This was due to an issue in Visual Studio 2015 Update 3 setup that sometimes caused stale entries in the devenv.exe.config file.

Can you try the following workaround:

  1. Close Visual Studio
  2. Delete the C:\Users\AppData\Local\Microsoft\VisualStudio\14.0\devenv.exe.config file.
  3. Run the Developer Command Prompt for VS2015 as the Administrator, and execute the devenv /setup command.

balachir avatar Jul 12 '16 00:07 balachir

@balachir I have tried this exact step several times and still have the exact same error when trying to create a new .NET core project.

I have attached the ProcessMonitor output for the devenv.exe process while I ran the /setup command and also up to when I tried to create a new .NET core project (including the error dialog).

[Logfile.zip](url) (The output is filtered where RESULT is not SUCCESS.)

Seany84 avatar Jul 12 '16 21:07 Seany84

I am also facing the same issue. I have installed VS2015 update 2. I tried to follow the above steps but strangely the below directory is empty C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\DotNet

Even there is no dnx folder at below path *:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\DNX *

I've run RC1 installation successfully and even repaired it many time. But somehow there is nothing installed in the dotnet folder at C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\DotNet path

@bernharde @olegburov or anyone - Can you please suggest something else to solve this problem.

I even repaired VS2015 installation. deleted dev.exe.config file ran devenv /setup in vs2015 command prompt (as administrator)

I guess the root problem is nothing is installed in dotnet folder in programfiles and no dnx folder is created.

Need help urgently.

amicalrahul avatar Jul 15 '16 19:07 amicalrahul

@Seany84 this seems to be related to VS tooling and https://github.com/aspnet/tooling/issues seems like the correct place for it. I will close this one, can you please open it (if it still repros) on the repo I linked to? Thanks!

thesmithee avatar Jul 21 '16 03:07 thesmithee