Hi everyone! We downloaded by mistake a project with .NET 4.6.1 as framework. Unfortunately, we need to have the application on .NET Core 2. Is there a way to manipulate our solution that the target framework is .NET Core 2.1 instead? Thanks in advance! Christian
3 Answer(s)
-
1
Duplicate of https://support.aspnetzero.com/QA/Questions/4431:
For the most part, you can just change the
<TargetFramework>
in .csproj files fromnet461
tonetcoreapp2.0
.It's better to download a new project with .NET Core 2.1 as framework, with the same name.
-
0
Hi Aaron!
Thank you for you answer. I changed all the targetframework attributes and it almost worked out. The problem was SignalR that I had to also adjust to the .Net Core template.
So I adjusted a bunch of classes that I fortunately did not change since the project start. But now after all the changes I stuck during the startup on an error:
‘MyProject.Web.Chat.SignalR.SignalRChatCommunicator' is waiting for the following dependencies:
- Service 'Microsoft.AspNetCore.SignalR.IHubContext`1[[MyProject.Web.Chat.SignalR.ChatHub, MyProject.Web.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null]]' which was not registered.’ Do you know where I can register the IHubContext? I could not find the place in a blank .Net Core project where that is done.
Thanks a lot!
-
0
Check that you have this line in Startup.cs:
routes.MapHub<ChatHub>("/signalr-chat");