Skip to content

Project working in VS doesn't work with cli (not fully restoring? + other issues) #4550

@krwq

Description

@krwq

See https://github.com/krwq/cli/tree/dotnet_api/test/Microsoft.DotNet.Tools.Api
open in VS -> build and run - works

dotnet cli:
dotnet restore + dotnet run anyarg:

X:\oss\cli-2\test\Microsoft.DotNet.Tools.Api>dotnet run anyarg
Running X:\oss\cli-2\artifacts\win7-x64\stage2\bin\dotnet-run.exe anyarg
> X:\oss\cli-2\artifacts\win7-x64\stage2\bin\dotnet-run.exe anyarg
Process ID: 9524
Could not connect with the server.
System.AggregateException: One or more errors occurred. ---> System.TypeInitializationException: The type initializer for 'System.Net.SystemNetworkCredential' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Security.SecureString, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
   at System.Net.NetworkCredential.set_Password(String value)
   at System.Net.SystemNetworkCredential..ctor()
   at System.Net.SystemNetworkCredential..cctor()
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.DotNet.Tools.Api.Program.Main(String[] args) in X:\oss\cli-2\test\Microsoft.DotNet.Tools.Api\Program.cs:line 36
---> (Inner Exception #0) System.TypeInitializationException: The type initializer for 'System.Net.SystemNetworkCredential' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Security.SecureString, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
   at System.Net.NetworkCredential.set_Password(String value)
   at System.Net.SystemNetworkCredential..ctor()
   at System.Net.SystemNetworkCredential..cctor()
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)<---

< X:\oss\cli-2\artifacts\win7-x64\stage2\bin\dotnet-run.exe anyarg exited with 1 in 2153 ms.

There is actually more issues. If you add that packages by hand to force restore then dotnet run actually crashes while throwing different exception...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions