I'm trying to compile a fairly straightforward C++ project into ELF format for containerization, and I actually had it working briefly, but now, when I try to build ANY C++ code via WSL2, it fails in the CMake stage, before it can even configure itself. I have uninstalled and reinstalled VS 2022 17.4, and even rolled back the latest Windows 11 update from yesterday, just in case, but I still get the same error implying that a cmake library isn't loading properly (although I've even installed the MS cmake in my WSL environment):
10:26:15.5353681 [Info, Thread 54] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.BuildProjectScannerService: Switching config to linux-debug
10:26:15.5363640 [Info, Thread 50] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.WaitableIndexService: WaitableIndexService listening to IndexService at Completed
10:26:15.5363640 [Info, Thread 47] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.BuildProjectScannerService: OnFileScannerCompleted for CMakeLists.txt
10:26:15.5388714 [Info, Thread 54] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.ParseCache: Canceling all ongoing generations for workspaceDirectory='C:\Users\kenne\source\repos\TestCMake'
10:26:15.5398772 [Warning, Thread 54] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.BuildProjectScannerService: Data is not valid, just removing canceled for CMakeLists.txt linux-debug
10:26:15.5408777 [Info, Thread 53] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.BuildProjectScannerService: Starting scan ...
10:26:15.5428770 [Info, Thread 15] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.BuildProjectScannerService: Scanner Parsing starting: projectfilepath CMakeLists.txt Config Name:linux-debug
10:26:15.5498775 [Info, Thread 53] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.WaitableIndexService: WaitableIndexService listening to IndexService at Completed
10:26:15.5778801 [Info, Thread 47] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.ParseCache: CacheGenerationStarted root: CMAKELISTS.TXTlinux-debug CMakeLists.txt linux-debug
10:26:15.5859133 [Info, Thread 47] Microsoft.VisualStudio.CMake.Linux.Project.RemoteCMakeParser: RemoteCMakeParser ctor
10:26:15.5869118 [Info, Thread 47] libcmake.Linux.RemoteCMakeParser: RemoteCMakeParser ctor
10:26:15.5869118 [Info, Thread 47] Microsoft.VisualStudio.CMake.Linux.Project.RemoteCMakeParser: RemoteCMakeParser finished
10:26:15.5909273 [Error, Thread 47] Microsoft.VisualStudio.CMake.Project.ExternalBuildProject.ProjectProvider: System.MissingMethodException: Method not found: 'Void libcmake.CMakeParameters..ctor(System.String, System.String, libcmake.CMakeConfiguration)'.
at libcmake.Linux.RemoteCMakeParameters..ctor(String daemonDirectory, String cmakeListsDirectory, Func`1 remoteSourceFilesDirectoryResolver, Func`1 remoteCMakeListsTxtDirectoryResolver, CMakeConfiguration config)
at Microsoft.VisualStudio.CMake.Linux.Project.RemoteCMakeParserProvider.GetCMakeParameters(String cmakeListsFileOrDirectory, CMakeWorkspaceConfiguration cmakeConfiguration, String workspaceDirectory)
at Microsoft.VisualStudio.CMake.Project.Utils.<GetCMakeParametersAsync>d__35.MoveNext()
End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.CMake.Project.ExternalBuildProject.ProjectProvider.<ParseProjectAsync>d__46.MoveNext()
10:26:15.5909273 [Error, Thread 47] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.ParseCache: Unknown exception during cache generation: root: CMAKELISTS.TXTlinux-debug CMakeLists.txt linux-debug
10:26:15.5919103 [Error, Thread 47] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.ParseCache: System.MissingMethodException: Method not found: 'Void libcmake.CMakeParameters..ctor(System.String, System.String, libcmake.CMakeConfiguration)'.
at libcmake.Linux.RemoteCMakeParameters..ctor(String daemonDirectory, String cmakeListsDirectory, Func`1 remoteSourceFilesDirectoryResolver, Func`1 remoteCMakeListsTxtDirectoryResolver, CMakeConfiguration config)
at Microsoft.VisualStudio.CMake.Linux.Project.RemoteCMakeParserProvider.GetCMakeParameters(String cmakeListsFileOrDirectory, CMakeWorkspaceConfiguration cmakeConfiguration, String workspaceDirectory)
at Microsoft.VisualStudio.CMake.Project.Utils.<GetCMakeParametersAsync>d__35.MoveNext()
End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.CMake.Project.ExternalBuildProject.ProjectProvider.<ParseProjectAsync>d__46.MoveNext()
End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.CMake.Project.ExternalBuildProject.ProjectProvider.<ParseProjectAsync>d__46.MoveNext()
End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.ParseCache.<ParseAsyncImpl>d__34.MoveNext()
10:26:15.5939244 [Info, Thread 47] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.BuildProjectScannerService: Scanner Parsing done: projectfilepath CMakeLists.txt Config Name:linux-debug, took 51ms.
10:26:15.5939244 [Info, Thread 47] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.BuildProjectScannerService: Compute file data values for CMakeLists.txt Config linux-debug
10:26:15.5939244 [Error, Thread 47] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.BuildProjectScannerService: FDV Error for CMakeLists.txt Config linux-debug Canceled False AutoGenerateCanceled False
10:26:15.5988930 [Info, Thread 6] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.BuildProjectScannerService: OnFileScannerCompleted for CMakeLists.txt
10:26:15.5988930 [Info, Thread 15] Microsoft.VisualStudio.Workspace.ExternalBuildFramework.Impl.Services.BuildProjectScannerService: Finishing scan.
I've tried deleting and rebuilding the cmake cache, I've tweaked the cmake presets, I've followed the MS instructions on using WSL2 to compile for Linux, but it never works any more.
After poking around the MS site(s) long enough, an answer scurried out from behind a shrubbery...
The VS 17.4 update (11/30/2022) killed the cmake/wsl integration. So, until they sort that out, I'm going to try to uninstall and reinstall 17.2
https://developercommunity.visualstudio.com/t/CMake-Project-stopped-working-on-WSL-aft/10216023
Related
I was trying to run ASP.NET Core Application
this is global.json
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-rc1-update2"
}
}
I encountered error restore packages failed
this is output
PATH=.\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\git
C:\Users\AA\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update2\bin\dnx.exe "C:\Users\AA\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update2\bin\lib\Microsoft.Dnx.Tooling\Microsoft.Dnx.Tooling.dll" restore "D:\MyProject\src\MyProject"
Microsoft .NET Development Utility Clr-x86-1.0.0-rc1-16609
GET https://api.nuget.org/v3/index.json
Restoring packages for D:\MyProject\src\MyProject\project.json
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.ApplicationInsights.AspNet'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Diagnostics'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.IISPlatformHandler'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Mvc'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Mvc.TagHelpers'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Server.Kestrel'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.StaticFiles'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Tooling.Razor'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.CodeGenerators.Mvc'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Configuration.FileProviderExtensions'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Configuration.Json'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Configuration.UserSecrets'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Logging'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Logging.Console'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Logging.Debug'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.VisualStudio.Web.BrowserLink.Loader'
Warning: FindPackagesById: Microsoft.ApplicationInsights.AspNet
An error occurred while sending the request.
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.ApplicationInsights.AspNet'
Warning: FindPackagesById: Microsoft.AspNet.Server.Kestrel
An error occurred while sending the request.
Warning: FindPackagesById: Microsoft.AspNet.Mvc.TagHelpers
An error occurred while sending the request.
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Server.Kestrel'
Warning: FindPackagesById: Microsoft.AspNet.Tooling.Razor
An error occurred while sending the request.
Warning: FindPackagesById: Microsoft.Extensions.Configuration.FileProviderExtensions
An error occurred while sending the request.
Warning: FindPackagesById: Microsoft.Extensions.Logging.Debug
An error occurred while sending the request.
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Mvc.TagHelpers'
Warning: FindPackagesById: Microsoft.AspNet.StaticFiles
An error occurred while sending the request.
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Tooling.Razor'
Warning: FindPackagesById: Microsoft.Extensions.Logging
An error occurred while sending the request.
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.StaticFiles'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Logging.Debug'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Configuration.FileProviderExtensions'
Warning: FindPackagesById: Microsoft.VisualStudio.Web.BrowserLink.Loader
An error occurred while sending the request.
Warning: FindPackagesById: Microsoft.Extensions.CodeGenerators.Mvc
An error occurred while sending the request.
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Logging'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.VisualStudio.Web.BrowserLink.Loader'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.CodeGenerators.Mvc'
Warning: FindPackagesById: Microsoft.Extensions.Configuration.Json
An error occurred while sending the request.
Warning: FindPackagesById: Microsoft.Extensions.Logging.Console
An error occurred while sending the request.
Warning: FindPackagesById: Microsoft.AspNet.Diagnostics
An error occurred while sending the request.
Warning: FindPackagesById: Microsoft.Extensions.Configuration.UserSecrets
An error occurred while sending the request.
Warning: FindPackagesById: Microsoft.AspNet.IISPlatformHandler
An error occurred while sending the request.
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Configuration.Json'
Warning: FindPackagesById: Microsoft.AspNet.Mvc
An error occurred while sending the request.
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.IISPlatformHandler'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Mvc'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Diagnostics'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Configuration.UserSecrets'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Logging.Console'
Warning: FindPackagesById: Microsoft.ApplicationInsights.AspNet
An error occurred while sending the request.
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.ApplicationInsights.AspNet'
Warning: FindPackagesById: Microsoft.AspNet.Server.Kestrel
An error occurred while sending the request.
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Server.Kestrel'
Warning: FindPackagesById: Microsoft.AspNet.Mvc.TagHelpers
An error occurred while sending the request.
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Mvc.TagHelpers'
Warning: FindPackagesById: Microsoft.AspNet.StaticFiles
An error occurred while sending the request.
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.StaticFiles'
Warning: FindPackagesById: Microsoft.AspNet.Tooling.Razor
An error occurred while sending the request.
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Tooling.Razor'
Warning: FindPackagesById: Microsoft.VisualStudio.Web.BrowserLink.Loader
An error occurred while sending the request.
Warning: FindPackagesById: Microsoft.Extensions.Logging.Debug
An error occurred while sending the request.
Warning: FindPackagesById: Microsoft.Extensions.Logging
An error occurred while sending the request.
Warning: FindPackagesById: Microsoft.Extensions.Configuration.FileProviderExtensions
An error occurred while sending the request.
Warning: FindPackagesById: Microsoft.Extensions.CodeGenerators.Mvc
An error occurred while sending the request.
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Configuration.FileProviderExtensions'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.VisualStudio.Web.BrowserLink.Loader'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Logging.Debug'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.CodeGenerators.Mvc'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Logging'
Warning: FindPackagesById: Microsoft.AspNet.IISPlatformHandler
An error occurred while sending the request.
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.IISPlatformHandler'
Warning: FindPackagesById: Microsoft.AspNet.Diagnostics
An error occurred while sending the request.
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Diagnostics'
Warning: FindPackagesById: Microsoft.Extensions.Logging.Console
An error occurred while sending the request.
Warning: FindPackagesById: Microsoft.Extensions.Configuration.Json
An error occurred while sending the request.
Warning: FindPackagesById: Microsoft.Extensions.Configuration.UserSecrets
An error occurred while sending the request.
Warning: FindPackagesById: Microsoft.AspNet.Mvc
An error occurred while sending the request.
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Logging.Console'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Configuration.Json'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Mvc'
GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.Extensions.Configuration.UserSecrets'
Error: FindPackagesById: Microsoft.AspNet.Mvc.TagHelpers
An error occurred while sending the request.
Error: FindPackagesById: Microsoft.ApplicationInsights.AspNet
An error occurred while sending the request.
----------
Error: FindPackagesById: Microsoft.AspNet.Tooling.Razor
An error occurred while sending the request.
Error: FindPackagesById: Microsoft.AspNet.Server.Kestrel
An error occurred while sending the request.
Error: FindPackagesById: Microsoft.AspNet.StaticFiles
An error occurred while sending the request.
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Dnx.Tooling.Restore.NuGet.HttpSource.<GetAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Dnx.Tooling.Restore.NuGet.NuGetv2Feed.<FindPackagesByIdAsyncCore>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dnx.Tooling.RemoteWalkProvider.<FindLibrary>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dnx.Tooling.RestoreOperations.<FindLibrary>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Dnx.Tooling.RestoreOperations.<FindLibraryByVersion>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Dnx.Tooling.RestoreOperations.<FindLibraryMatch>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dnx.Tooling.RestoreOperations.<FindLibraryEntry>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Dnx.Tooling.RestoreOperations.<CreateGraphNode>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Dnx.Tooling.RestoreOperations.<CreateGraphNode>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dnx.Tooling.RestoreCommand.<CreateGraphNode>d__71.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Dnx.Tooling.RestoreCommand.<RestoreForProject>d__69.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dnx.Tooling.RestoreCommand.<>c__DisplayClass68_0.<<Execute>b__2>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Dnx.Tooling.RestoreCommand.<Execute>d__68.MoveNext()
----------
Restore failed
An error occurred while sending the request.
NuGet Config files used:
C:\ProgramData\NuGet\Config\Microsoft.VisualStudio.Offline.config
C:\Users\AA\AppData\Roaming\NuGet\nuget.config
Feeds used:
https://api.nuget.org/v3/index.json
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
this is project.json
{
"version": "1.0.0-*",
"userSecretsId": "aspnetcore-MyProject-3db060cf-000d-481d-b013-6fcaf0c10504",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.ApplicationInsights.AspNet": "1.0.0-rc1",
"Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final",
"Microsoft.Extensions.CodeGenerators.Mvc": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
},
"frameworks": {
"dnx46": { },
"dnxcore50": { }
},
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
],
"publishExclude": [
"**.user",
"**.vspscc"
],
"scripts":{
"prepublish": [
"npm install",
"bower install",
"gulp clean",
"gulp min"
]
}
}
I installed dnx 1.0.0-rc1-update2 in .dnx and sdk 1.0.0-preview-1-003177 in dotnet/sdk
I removed dnxcore5.0 and changed frameworks in project.json as the following:
"frameworks": {
"dnx46": { }
}
and changed SDK in global.json as the following:
"sdk": {
"version": "1.0.0-preview2-1-003177"
}
because I searched for 1.0.0-rc1-update2 and didn't find
After that packges are restored successfully
but when I tried to run, I encountered this error
Unable to start process D:\MyProject\artifacts\bin\MyProject\bin\Debug\dnx46\win-x64\MyProject.exe
request failed with status code 500 Internal server error.
the full response has been written to C:\Users\AA\AppData\Local\Temp\HttpFailure_06_00_18.html
After restarting Visual Studio this error appeared:
An unhandled exception of type 'System.InvalidOperationException' occurred in Microsoft.Extensions.DependencyInjection.Abstractions.dll
Additional information: No service for type 'Microsoft.Extensions.PlatformAbstractions.IApplicationEnvironment' has been registered.
Problem:
I wish to generate a Swagger file (Open API document) from an ASP.NET Core 2.2 Web API project (either from the solution file or Compiled assemblies).
Everything is tried using the NSwag tools.
Setup
I've installed NSwag studio so "nswag" command is directly available from Command prompt. I've also built using the following way as recommended:
dotnet build /p:CopyLocalLockFileAssemblies=true
Error: Command Line
The error I get after using AspNetCore2OpenApi command is:
Command: aspnetcore2openapi /assembly:TestApi.dll /documentName:OpenApi3 /output:swagger.json
System.InvalidOperationException: The command 'aspnetcore2openapi /assembly:testapi.dll /documentname:openapi3 /output:swagger.json' could not be found.
at NConsole.CommandLineProcessor.<ProcessSingleAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NConsole.CommandLineProcessor.<ProcessAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NConsole.CommandLineProcessor.Process(String[] args, Object input)
at NSwag.Commands.NSwagCommandProcessor.Process(String[] args)
Error:NSwagStudio
System.NullReferenceException: Object reference not set to an instance of an object.
Runtime: NetCore22
at CatalogApi.Extensions.HttpClientPolicyExtensions.AddPolicies(IServiceCollection services, IConfiguration configuration) in C:\Users\ansiddiq\Source\Repos\SS-ME-ES-APIC-CatalogService\Api\CatalogApi\Extensions\HttpClientPolicyExtensions.cs:line 36
at CatalogApi.Startup.ConfigureServices(IServiceCollection services) in C:\Users\ansiddiq\Source\Repos\SS-ME-ES-APIC-CatalogService\Api\CatalogApi\Startup.cs:line 102
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
at NSwag.Commands.Generation.OpenApiGeneratorCommandBase`1.CreateWebHostAsync(AssemblyLoader assemblyLoader) in C:\projects\nswag\src\NSwag.Commands\Commands\Generation\OpenApiGeneratorCommandBase.cs:line 318
at NSwag.Commands.Generation.AspNetCore.AspNetCoreToSwaggerCommand.RunIsolatedAsync(AssemblyLoader assemblyLoader) in C:\projects\nswag\src\NSwag.Commands\Commands\Generation\AspNetCore\AspNetCoreToOpenApiCommand.cs:line 309
at NSwag.Commands.IsolatedCommandBase`1.IsolatedCommandAssemblyLoader`1.Run(String commandType, String commandData, String[] assemblyPaths, String[] referencePaths) in C:\projects\nswag\src\NSwag.Commands\Commands\IsolatedCommandBase.cs:line 71
at NSwag.Commands.IsolatedCommandBase`1.<>c__DisplayClass17_0.<RunIsolatedAsync>b__0() in C:\projects\nswag\src\NSwag.Commands\Commands\IsolatedCommandBase.cs:line 61
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at NSwag.Commands.IsolatedCommandBase`1.RunIsolatedAsync(String configurationFile)
at NSwag.Commands.IsolatedSwaggerOutputCommandBase`1.RunAsync(CommandLineProcessor processor, IConsoleHost host) in C:\projects\nswag\src\NSwag.Commands\Commands\IsolatedSwaggerOutputCommandBase.cs:line 47
at NSwag.Commands.Generation.AspNetCore.AspNetCoreToSwaggerCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in C:\projects\nswag\src\NSwag.Commands\Commands\Generation\AspNetCore\AspNetCoreToOpenApiCommand.cs:line 94
at NSwag.Commands.NSwagDocumentBase.GenerateSwaggerDocumentAsync() in C:\projects\nswag\src\NSwag.Commands\NSwagDocumentBase.cs:line 279
at NSwag.Commands.NSwagDocument.ExecuteAsync() in C:\projects\nswag\src\NSwag.Commands\NSwagDocument.cs:line 81
at NSwag.Commands.Document.ExecuteDocumentCommand.ExecuteDocumentAsync(IConsoleHost host, String filePath) in C:\projects\nswag\src\NSwag.Commands\Commands\Document\ExecuteDocumentCommand.cs:line 85
at NSwag.Commands.Document.ExecuteDocumentCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in C:\projects\nswag\src\NSwag.Commands\Commands\Document\ExecuteDocumentCommand.cs:line 32
at NConsole.CommandLineProcessor.ProcessSingleAsync(String[] args, Object input)
at NConsole.CommandLineProcessor.ProcessAsync(String[] args, Object input)
at NConsole.CommandLineProcessor.Process(String[] args, Object input)
at NSwag.Commands.NSwagCommandProcessor.Process(String[] args) in C:\projects\nswag\src\NSwag.Commands\NSwagCommandProcessor.cs:line 56
This error seems to be in a file where I use "Polly" library in Middleware for HTTP Retry logic. There is no problem in the code as it compiles/runs fine.
Any help is appreciated!
I implemented ASP.NET Core Windows Authentication supporting Cookie
In Startup.cs
services.AddAuthentication(IISDefaults.AuthenticationScheme);
services.AddAuthentication("CookieAuthenticationScheme")
.AddCookie("CookieAuthenticationScheme");
On Login:
var claims = new List<Claim>{new Claim(ClaimTypes.Name, userName)};
await httpContext.SignInAsync("CookieAuthenticationScheme", new ClaimsPrincipal(new ClaimsIdentity(claims, "CookieAuthenticationScheme")));
It works okay. But if no one uses the application for a while, and when user logs in the application again it raises this error:
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost/api/User/GetCurrentUserInfo
info: Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler[7]
CookieAuthenticationScheme was not authenticated. Failure message: Unprotect ticket failed
info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2]
Authorization failed for user: (null).
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[3]
Authorization failed for the request at filter 'Microsoft.AspNetCore.Mvc.Authorization.AuthorizeFilter'.
info: Microsoft.AspNetCore.Mvc.ChallengeResult[1]
Executing ChallengeResult with authentication schemes ().
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
Executed action Application.Controllers.UserController.GetCurrentUserInfo (Application) in 0.251ms
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 23.2483ms 401
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost/api/User/GetCurrentUserInfo
info: Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler[7]
CookieAuthenticationScheme was not authenticated. Failure message: Unprotect ticket failed
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
Executed action Application.Controllers.UserController.GetCurrentUserInfo (Application) in 1.1302ms
fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HLB9USN79JN9", Request id "0HLB9USN79JN9:00000002": An unhandled exception was thrown by the application.
System.ObjectDisposedException: Safe handle has been closed
at System.Runtime.InteropServices.SafeHandle.DangerousAddRef(Boolean& success)
at System.StubHelpers.StubHelpers.SafeHandleAddRef(SafeHandle pHandle, Boolean& success)
at Interop.Advapi32.LsaLookupSids(SafeLsaPolicyHandle handle, Int32 count, IntPtr[] sids, SafeLsaMemoryHandle& referencedDomains, SafeLsaMemoryHandle& names)
at System.Security.Principal.SecurityIdentifier.TranslateToNTAccounts(IdentityReferenceCollection sourceSids, Boolean& someFailed)
at System.Security.Principal.SecurityIdentifier.Translate(IdentityReferenceCollection sourceSids, Type targetType, Boolean& someFailed)
at System.Security.Principal.SecurityIdentifier.Translate(IdentityReferenceCollection sourceSids, Type targetType, Boolean forceSuccess)
at System.Security.Principal.SecurityIdentifier.Translate(Type targetType)
at System.Security.Principal.WindowsIdentity.<GetName>b__45_0()
at System.Security.Principal.WindowsIdentity.<>c__DisplayClass61_0.<RunImpersonatedInternal>b__0(Object <state>)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Security.Principal.WindowsIdentity.RunImpersonatedInternal(SafeAccessTokenHandle token, Action action)
at System.Security.Principal.WindowsIdentity.RunImpersonated(SafeAccessTokenHandle safeAccessTokenHandle, Action action)
at System.Security.Principal.WindowsIdentity.GetName()
at System.Security.Principal.WindowsIdentity.get_Name()
at Microsoft.AspNetCore.Authorization.DefaultAuthorizationService.GetUserNameForLogging(ClaimsPrincipal user)
at Microsoft.AspNetCore.Authorization.DefaultAuthorizationService.<AuthorizeAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.AspNetCore.Authorization.Policy.PolicyEvaluator.<AuthorizeAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.AspNetCore.Mvc.Authorization.AuthorizeFilter.<OnAuthorizationAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeFilterPipelineAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.<Invoke>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.<Invoke>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.<Invoke>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Builder.Extensions.UsePathBaseMiddleware.<Invoke>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.<Invoke>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame`1.<ProcessRequestsAsync>d__2.MoveNext()
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 20.4616ms 500
The point of windows authentication is to allow the server to do its own thing. When you try using cookies to handle authentication, you're effectively letting the system authenticate, then storing that authentication client side.
The system's authorization for that user is expiring in IIS, but the user's own cookie is saying that they're still authenticated.
I believe what you may actually be trying to do is enable both windows authentication and anonymous users. This answer has some details on how to accomplish this.
This answer also seems to support that you do not want cookie auth here.
You may also want to review the setup guide for windows auth in ASP.NET Core as laid out in this article.
We are using Azure Graph API client library version 2.1.1.0. Our application tries to validate the user roles at the time of login. While doing this ad client. Following call seems to be throwing an exception. Any help in this regard is highly appreciated.
Call:
adClient.Users
.Expand(_ => _.MemberOf)
.Where(_ => _.ObjectId == objectId)
.ExecuteAsync()
.Result;
adClient.DirectoryRoles
.Expand(_ => _.Members)
.ExecuteAsync()
.Result;.
Exception Details:
---> (Inner Exception #0) System.InvalidOperationException: The context is already tracking a different entity with the same resource Uri.
at System.Data.Services.Client.EntityTracker.InternalAttachEntityDescriptor(EntityDescriptor entityDescriptorFromMaterializer, Boolean failIfDuplicated)
at System.Data.Services.Client.AtomMaterializerLog.ApplyToContext()
at System.Data.Services.Client.MaterializeAtom.MoveNextInternal()
at System.Data.Services.Client.MaterializeAtom.MoveNext()
at System.Linq.Enumerable.d__941.MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Microsoft.Azure.ActiveDirectory.GraphClient.Extensions.PagedCollection2..ctor(DataServiceContextWrapper context, QueryOperationResponse1 qor)
at Microsoft.Azure.ActiveDirectory.GraphClient.Extensions.DataServiceContextWrapper.<>c__DisplayClass4c2.b__4a(IAsyncResult r)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.ActiveDirectory.GraphClient.Extensions.DataServiceContextWrapper.d__4e2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.ActiveDirectory.GraphClient.Extensions.ReadOnlyQueryableSet2.<b__0>d__2.MoveNext()<---
we are seeing following issue - we have couple of actor systems with actor instances - most of them are windows services - and exchange messages between them - this is generally working. We have now introduced new actor which is linked to API and therefore resides within IIS
this for some reason prevents messages to be delivered between windows service actor instance and remote actor which resides in IIS
using akka.net 1.1.1 and helios 2.1.3
the same actor code and config, when moved to another windows service does behave as expected
the IIS app is running and I can see netstat showing the port as listening and was even able to debug the code as far as socket being bound however under iis I get socket exception
*2016-08-23 10:02:44.232 +01:00 [Warning] Tried to associate with unreachable remote address ["akka.tcp://NodeSystem#127.0.0.1:7096"]. Address is now gated for 5000 ms, all messages to this address will be delivered to dead letters. Reason: ["Invalid address: akka.tcp://NodeSystem#127.0.0.1:7096"] "Caused by: [Akka.Remote.Transport.InvalidAssociationException: Association failure ---> Helios.Exceptions.HeliosConnectionException: failed as a result of System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> Helios.Channels.ConnectException: LogError connecting to 127.0.0.1:7096 ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at Helios.Channels.Sockets.SocketChannelAsyncOperation.Validate()
at Helios.Channels.Sockets.TcpSocketChannel.DoFinishConnect(SocketChannelAsyncOperation operation)
at Helios.Channels.Sockets.AbstractSocketChannel.AbstractSocketUnsafe.FinishConnect(SocketChannelAsyncOperation operation)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Helios.Channels.Bootstrap.ClientBootstrap.<DoResolveAndConnect>d__15.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at Akka.Remote.Transport.Helios.HeliosTcpTransport.<>c.<AssociateInternal>b__1_0(Task`1 tr)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> Helios.Channels.ConnectException: LogError connecting to 127.0.0.1:7096 ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at Helios.Channels.Sockets.SocketChannelAsyncOperation.Validate()
at Helios.Channels.Sockets.TcpSocketChannel.DoFinishConnect(SocketChannelAsyncOperation operation)
at Helios.Channels.Sockets.AbstractSocketChannel.AbstractSocketUnsafe.FinishConnect(SocketChannelAsyncOperation operation)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Helios.Channels.Bootstrap.ClientBootstrap.<DoResolveAndConnect>d__15.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at Akka.Remote.Transport.Helios.HeliosTcpTransport.<>c.<AssociateInternal>b__1_0(Task`1 tr)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> Helios.Channels.ConnectException: LogError connecting to 127.0.0.1:7096 ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at Helios.Channels.Sockets.SocketChannelAsyncOperation.Validate()
at Helios.Channels.Sockets.TcpSocketChannel.DoFinishConnect(SocketChannelAsyncOperation operation)
at Helios.Channels.Sockets.AbstractSocketChannel.AbstractSocketUnsafe.FinishConnect(SocketChannelAsyncOperation operation)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Helios.Channels.Bootstrap.ClientBootstrap.<DoResolveAndConnect>d__15.MoveNext()
---> (Inner Exception #0) Helios.Channels.ConnectException: LogError connecting to 127.0.0.1:7096 ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at Helios.Channels.Sockets.SocketChannelAsyncOperation.Validate()
at Helios.Channels.Sockets.TcpSocketChannel.DoFinishConnect(SocketChannelAsyncOperation operation)
at Helios.Channels.Sockets.AbstractSocketChannel.AbstractSocketUnsafe.FinishConnect(SocketChannelAsyncOperation operation)
--- End of inner exception stack trace ---<---
<---
<---
---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> Helios.Channels.ConnectException: LogError connecting to 127.0.0.1:7096 ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at Helios.Channels.Sockets.SocketChannelAsyncOperation.Validate()
at Helios.Channels.Sockets.TcpSocketChannel.DoFinishConnect(SocketChannelAsyncOperation operation)
at Helios.Channels.Sockets.AbstractSocketChannel.AbstractSocketUnsafe.FinishConnect(SocketChannelAsyncOperation operation)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Helios.Channels.Bootstrap.ClientBootstrap.<DoResolveAndConnect>d__15.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at Akka.Remote.Transport.Helios.HeliosTcpTransport.<>c.<AssociateInternal>b__1_0(Task`1 tr)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at Akka.Remote.Transport.Helios.HeliosTcpTransport.<>c.<AssociateInternal>b__1_1(Task`1 r)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Akka.Remote.Transport.Helios.HeliosTransport.<Associate>d__27.MoveNext()
--- End of inner exception stack trace ---]"
2016-08-23 10:02:44.233 +01:00 [Error] "Invalid address: akka.tcp://NodeSystem#127.0.0.1:7096"
Akka.Remote.InvalidAssociation: Invalid address: akka.tcp://NodeSystem#127.0.0.1:7096 ---> Akka.Remote.Transport.InvalidAssociationException: Association failure ---> Helios.Exceptions.HeliosConnectionException: failed as a result of System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> Helios.Channels.ConnectException: LogError connecting to 127.0.0.1:7096 ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at Helios.Channels.Sockets.SocketChannelAsyncOperation.Validate()
at Helios.Channels.Sockets.TcpSocketChannel.DoFinishConnect(SocketChannelAsyncOperation operation)
at Helios.Channels.Sockets.AbstractSocketChannel.AbstractSocketUnsafe.FinishConnect(SocketChannelAsyncOperation operation)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Helios.Channels.Bootstrap.ClientBootstrap.<DoResolveAndConnect>d__15.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at Akka.Remote.Transport.Helios.HeliosTcpTransport.<>c.<AssociateInternal>b__1_0(Task`1 tr)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> Helios.Channels.ConnectException: LogError connecting to 127.0.0.1:7096 ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at Helios.Channels.Sockets.SocketChannelAsyncOperation.Validate()
at Helios.Channels.Sockets.TcpSocketChannel.DoFinishConnect(SocketChannelAsyncOperation operation)
at Helios.Channels.Sockets.AbstractSocketChannel.AbstractSocketUnsafe.FinishConnect(SocketChannelAsyncOperation operation)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Helios.Channels.Bootstrap.ClientBootstrap.<DoResolveAndConnect>d__15.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at Akka.Remote.Transport.Helios.HeliosTcpTransport.<>c.<AssociateInternal>b__1_0(Task`1 tr)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> Helios.Channels.ConnectException: LogError connecting to 127.0.0.1:7096 ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at Helios.Channels.Sockets.SocketChannelAsyncOperation.Validate()
at Helios.Channels.Sockets.TcpSocketChannel.DoFinishConnect(SocketChannelAsyncOperation operation)
at Helios.Channels.Sockets.AbstractSocketChannel.AbstractSocketUnsafe.FinishConnect(SocketChannelAsyncOperation operation)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Helios.Channels.Bootstrap.ClientBootstrap.<DoResolveAndConnect>d__15.MoveNext()
---> (Inner Exception #0) Helios.Channels.ConnectException: LogError connecting to 127.0.0.1:7096 ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at Helios.Channels.Sockets.SocketChannelAsyncOperation.Validate()
at Helios.Channels.Sockets.TcpSocketChannel.DoFinishConnect(SocketChannelAsyncOperation operation)
at Helios.Channels.Sockets.AbstractSocketChannel.AbstractSocketUnsafe.FinishConnect(SocketChannelAsyncOperation operation)
--- End of inner exception stack trace ---<---
<---
<---
---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> Helios.Channels.ConnectException: LogError connecting to 127.0.0.1:7096 ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at Helios.Channels.Sockets.SocketChannelAsyncOperation.Validate()
at Helios.Channels.Sockets.TcpSocketChannel.DoFinishConnect(SocketChannelAsyncOperation operation)
at Helios.Channels.Sockets.AbstractSocketChannel.AbstractSocketUnsafe.FinishConnect(SocketChannelAsyncOperation operation)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Helios.Channels.Bootstrap.ClientBootstrap.<DoResolveAndConnect>d__15.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at Akka.Remote.Transport.Helios.HeliosTcpTransport.<>c.<AssociateInternal>b__1_0(Task`1 tr)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at Akka.Remote.Transport.Helios.HeliosTcpTransport.<>c.<AssociateInternal>b__1_1(Task`1 r)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Akka.Remote.Transport.Helios.HeliosTransport.<Associate>d__27.MoveNext()
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at Akka.Remote.EndpointWriter.PublishAndThrow(Exception reason, LogLevel level)
at Akka.Remote.EndpointWriter.<Initializing>b__24_1(Failure failure)
at lambda_method(Closure , Object , Action`1 , Action`1 , Action`1 )
at Akka.Tools.MatchHandler.PartialHandlerArgumentsCapture`4.Handle(T value)
at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, PartialAction`1 partialAction)
at Akka.Actor.ReceiveActor.OnReceive(Object message)
at Akka.Actor.UntypedActor.Receive(Object message)
at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
at Akka.Actor.ActorCell.ReceiveMessage(Object message)
at Akka.Actor.ActorCell.Invoke(Envelope envelope)
--- End of stack trace from previous location where exception was thrown ---
at Akka.Actor.ActorCell.HandleFailed(Failed f)
at Akka.Actor.ActorCell.SysMsgInvokeAll(EarliestFirstSystemMessageList messages, Int32 currentState)*
this is the hocon for the sending actor
akka {
# here we are configuring log levels
log-config-on-start = on
stdout-loglevel = INFO
loglevel = DEBUG
loggers = ["Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog"]
persistence
{
journal
{
plugin = "akka.persistence.journal.sql-server"
sql-server
{
# qualified type name of the SQL Server persistence journal actor
class = "Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.SqlServer"
# dispatcher used to drive journal actor
plugin-dispatcher = "akka.actor.default-dispatcher"
# connection string used for database access
connection-string = "Data Source=wcamm0q3pdbd1.gbcaydc.emea.bankofamerica.com,15001;Initial Catalog=BrokerDealer;User ID=BDLFUser;Password=dfnklgkdfkg"
# default SQL commands timeout
connection-timeout = 30s
# SQL server schema name to table corresponding with persistent journal
schema-name = dbo
# SQL server table corresponding with persistent journal
table-name = AKKAJournal
# should corresponding journal table be initialized automatically
auto-initialize = off
# timestamp provider used for generation of journal entries timestamps
timestamp-provider = "Akka.Persistence.Sql.Common.Journal.DefaultTimestampProvider, Akka.Persistence.Sql.Common"
# metadata table
metadata-table-name = AKKAMetadata
}
}
snapshot-store
{
plugin = "akka.persistence.snapshot-store.sql-server"
sql-server
{
# qualified type name of the SQL Server persistence journal actor
class = "Akka.Persistence.SqlServer.Snapshot.SqlServerSnapshotStore, Akka.Persistence.SqlServer"
# dispatcher used to drive journal actor
plugin-dispatcher = "akka.actor.default-dispatcher"
# connection string used for database access
connection-string = "Data Source=wcamm0q3pdbd1.gbcaydc.emea.bankofamerica.com,15001;Initial Catalog=BrokerDealer;User ID=BDLFUser;Password=dfgdfgdfg"
# default SQL commands timeout
connection-timeout = 30s
# SQL server schema name to table corresponding with persistent journal
schema-name = dbo
# SQL server table corresponding with persistent journal
table-name = AKKASnapshot
# should corresponding journal table be initialized automatically
auto-initialize = off
}
}
}
# this config section will be referenced as akka.actor
actor {
provider = "Akka.Remote.RemoteActorRefProvider, Akka.Remote"
debug {
receive = on
autoreceive = on
lifecycle = on
event-stream = on
unhandled = on
}
deployment {
/CashFundingManagementView {
router = smallest-mailbox-pool
nr-of-instances = 1
}
}
}
# here we're configuring the Akka.Remote module
remote {
helios.tcp {
transport-class =
"Akka.Remote.Transport.Helios.HeliosTcpTransport, Akka.Remote"
#applied-adapters = []
transport-protocol = tcp
port = 7095
hostname = "localhost"
}
log-remote-lifecycle-events = INFO
}
this is the destination actor path we use
akka.tcp://NodeSystem#127.0.0.1:7096/user/FundingManagementView
and the destination HOCON
akka {
loglevel = DEBUG
log-config-on-start = on
loggers = ["Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog"]
persistence {
snapshot-store {
# Path to the snapshot store plugin to be used
plugin = "akka.persistence.snapshot-store.local"
# Local filesystem snapshot store plugin.
local {
# Class name of the plugin.
class = "Akka.Persistence.Snapshot.LocalSnapshotStore, Akka.Persistence"
# Dispatcher for the plugin actor.
plugin-dispatcher = "akka.persistence.dispatchers.default-plugin-dispatcher"
# Dispatcher for streaming snapshot IO.
stream-dispatcher = "akka.persistence.dispatchers.default-stream-dispatcher"
# Storage location of snapshot files.
dir = "c:/logs"
}
}
}
actor {
provider = "Akka.Remote.RemoteActorRefProvider, Akka.Remote"
debug {
receive = on
autoreceive = on
lifecycle = on
event-stream = on
unhandled = on
}
deployment
{
/FundingManagementView
{
router = smallest-mailbox-pool
nr-of-instances = 1
}
/RealtimeControllerService
{
router = smallest-mailbox-pool
nr-of-instances = 1
}
/SignalRBridge
{
router = smallest-mailbox-pool
nr-of-instances = 1
}
}
}
remote {
helios.tcp {
transport-class = "Akka.Remote.Transport.Helios.HeliosTcpTransport, Akka.Remote"
transport-protocol = tcp
port = 7096
hostname = 0.0.0.0 # listen on all interfaces
public-hostname = "localhost"
}
}
}
any ideas as to diagnostics, I am currently trying to debug through the association workflow but it will take time...
the OS here is fairly locked down so I wonder if this is caused by some permission issue but still wonder why it inherently works win. service to win. service and not win.servie to IIS (Express) actor system
Any help greatly appreciated.
UPDATE
the same code/config is working on my colleague's box - sounds like my box is funny - I can telnet to the socket occassionally but more often than not, it stops listening