Signalr Core for ASP.net core 2.0 not working no matter what i try

↘锁芯ラ 提交于 2019-12-07 15:37:32

This helps a bit: https://github.com/aspnet/SignalR/issues/690

Update dotnet cli and aspnetcore

user8417576

Just for clarification because the emailing is sprawling account of my experience over 4 days of mixing and matching packages from different sources...

The trouble started at runtime without writing a line of code just f5 the default mvc template in visual studio 2017 15.3

  public static IWebHost BuildWebHost(string[] args) =>
    WebHost.CreateDefaultBuilder(args)
        .UseStartup<Startup>()
        .Build();

were various different ones depending on the package combinations i used

System.MissingMethodException occurred HResult=0x80131513
Message=Method not found: 'System.IDisposable.Microsoft.Extensions.Options.IOptionsMonitor1.OnChange(System.Action1)'. Source= StackTrace: at Microsoft.Extensions.Logging.Console.ConsoleLoggerProvider..ctor(IOptionsMonitor`1 options) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)

System.MissingMethodException occurred HResult=0x80131513
Message=Method not found: 'System.Collections.Generic.Dictionary`2 Microsoft.Extensions.Configuration.IConfigurationBuilder.get_Properties()'.

System.IO.FileLoadException occurred HResult=0x80131040 Message=Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.2.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Source= StackTrace: at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors) at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build() at WebApplication1.Program.BuildWebHost(String[] args) in D:\org\projects\fogbridge3\ActorModelDojo\src\Solution2\WebApplication1\Program.cs:line 21 at WebApplication1.Program.Main(String[] args) in D:\org\projects\fogbridge3\ActorModelDojo\src\Solution2\WebApplication1\Program.cs:line 17

again this is without writing a line of signalr code!!!

once i got a package combination of signalr with asp.net core all that passed without any runtime exception... i then added the signalr code.

the combination that got me passed the runtime errors of just plain vanilla mvc template code was

aspnetcore-release (prerelease) https://dotnet.myget.org/F/aspnetcore-release/api/v3/index.json for PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.0.0-preview2-25794" PackageReference Include="Microsoft.AspNetCore.SignalR.Http" Version="1.0.0-preview2-25794"

and

nuget.org (prerelease) ​https://api.nuget.org/v3/index.json PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0-preview2-final"

but then none of the clients i found worked

npm install signalr-client --registry dotnet.myget.org/F/aspnetcore-ci-dev/npm --save-dev

or the client mention at

github.com/aspnet/SignalR

thats when i had to edit the client myself to force it to at least hit a breakpoint at

    public override async Task OnConnectedAsync()
    {
        await Clients.Client(Context.ConnectionId).InvokeAsync("connectionmade", "connection made dude");

        await base.OnConnectedAsync();
    }

but i never succeeded in hitting my methods at

public async Task Send(string message)
{
    await Clients.All.InvokeAsync("Send",  message);
}
thanks that works but now docker image deployment breaks :(

are there any docs out there that can guide me to create my own aspnetcore 2.1 linux docker image  to deploy to?

-------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software
to help you develop and test your applications.
-------------------------------------------------------------------
realpath(): Invalid argument
realpath(): Invalid argument
realpath(): Invalid argument
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.0.0' was not found.
- Check application dependencies and target a framework version installed at:
/
- Alternatively, install the framework version '2.0.0'.
The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core.
The program '[52] dotnet' has exited with code 131 (0x83).
The program '' has exited with code 131 (0x83).
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!