How to use SignalR in aspnetcore 2.0, with c# and html/js for front end - model-view-controller

Am trying to install SIGNALR to my asp.net project, but when adding the Nugets, it keeps pushing an error that the "Package xxx was restored using .NETFramework, Version=v4.6.1 instead of the project framework .NETCoreApp, Version=v2.0". I get this error on several Nugets. I tried to re-install all Nuget one by one but same result when I arrive at some particular one like SIGNALR.
I believe I might have something wrong in the setup, but as am new to asp.net, would love a pointer. Read the literature but could not find the answer to this issue.
It also looks like SignalR might only be available for netcore 2.1 later this year but am looking for a way to use it, in a simple app.

So a couple of things.
For the latest SignalR Core bits you need to be targeting netcoreapp2.1. Preview1 and later depend on that.
If you want to just experiment with SignalR targeting netcoreapp2.0 the alpha 2 bits use netcoreapp2.0. But just to be clear the alpha bits are just a public preview and should not be used for production applications.
The main thing here though is that you are using the Microsoft.AspNet.SignalR packages. Those will not work on Core.

Related

How to migrate/update to newer version of Xamarin.Forms?

I have some xamarin.forms 1.xx( I dont know which version) project on multiple platforms Android and iOS. And I've been asked to upgrade it to the maximum available right now version of xamarin.forms.
Therefore, I have 2 questions:
1) How to determine which version of forms I'm using right now (I'm working in Windows environment using Visual Studio 2015 ).
2) How to migrate/update to newest version of forms? (step by step, if it's possible). I have no idea how the result of that kind of operation supposed to look like, cuz I have never done anything like this before in my life. And what the best practices are?
What I've done is opened VS2015->Help->Xamarin release notes, however there was nothing about version of Forms I'm using. Also, I went to the official xamarin website and there was no guide how to do that. I also tried to look at the release notes the last Forms update and trying to find and fix differences, but my project is so big and I thought that this way doesn't seems right.
I'll answer first the What are the best practice regarding upgrading a Xamarin.Forms application? first and then address your other concerns.
I recently upgraded from 1.5.1 to 2.3.2, and from my experience, this is the steps to go through:
Decide which version you will upgrade from and to.
Read the change logs for all stabled releases between these two versions and look for breaking changes/bugfixes. You can find the release notes on Xamarin's website or on NuGet's website too.
Check regularly for new releases on the Xamarin.Forms forum and check if any reported issues may affect you. Every time Xamarin makes a release, there is a thread full of comments from other developers that may have encountered issues you might be interested in.
Using your favorite versioning software, make sure that all local changes are commited or stashed and create a new branch for your Xamarin.Forms upgrade (you don't know how long the upgrade will take and you still want to be able to send patches during the process)
Upgrade: Read the Important notes at Xamarin.Forms 2.3.2 release notes, especially the When upgrading Xamarin.Forms take care not to simply "update all" as ... part. Remember to upgrade on your PCL project, on your iOS project and on your Android project.
Test your whole app on as many devices as possible and for the longest possible period before you merge your branch back into your development/master/Main branch and address the potential incompatibility issues that may have been created in your development/master/Main simultaneously.
Step 3 is very important as it will allow you to reset back to your starting point and restart if you should fail to upgrade for whatever reason.
Xamarin.Forms is moving fast so it's important that you always keep an eye on what's going on even if you don't upgrade.
Which version am I using right now?
You can check that in the NuGet package interface or in the packages.json file in your project.

Cannot use Service Stack inside a PCL

I am using Xamarin and need to use a PCL
However, I cannot install ServiceStack into the PCL other than the PCL package which is classed as no longer being maintained
Has anyone come across this?
I want to use PCL because I dont want to duplicate code
PCLs are supposed to be supported via the latest Service Stack but this does not appear to be the case
I have code which makes use of ToJson which is in ServiceStack.TExt
I know I could create a folder inside my iphone (and android) assemblies but I am not sure this is a good approach because it doesnt feel right (everything all in one place instead of in proper layers)
Does anyone have any ideas about this?
Paul
Your assumptions aren't correct, ServiceStack PCL Packages ARE still being maintained, but instead of being maintained in individual packages, e.g:
ServiceStack.Client.Pcl
ServiceStack.Text.Pcl
ServiceStack.Interfaces.Pcl
They have now been merged as different profiles into the main client NuGet packages, e.g:
ServiceStack.Client
ServiceStack.Text
ServiceStack.Interfaces

If I upgrade Foundation V3 to V4 will V3 projects still compile

I am using Zurb Foundation V3 currently. Does anybody know if I upgrade Foundation V3 to V4 will V3 projects still compile using V3 gems/sass? Can the two versions of Foundation be used on the same computer for different projects or will I have to migrate all my existing projects to V4 if I upgrade?
Many thanks.
There is a migration guideline documented in Zurb's website. Your design will not change, at least it should not be, as things still work pretty much the same. But you will certainly have to change some markups. Take for example the classes for the grid which is, arguably, Foundation's heart.
About using different versions, yes I think it should work as long as you only use a specific version for one project, it doesn't matter if they are on a single computer.

Nuget versioning for MVC3 -> 4 extension library: to hide or not to hide previous versions?

I have an extension package on our corporate nuget server for Asp.Net MVC 3 - let's say the package ID is currently Acme.Mvc and it's version is 2.x.
I've now branched that project and going to put a pre-release version of the same package targetted at MVC 4 Beta. Now, logically this is now version 3.x of the library; however, as soon as I release it (once it's no longer pre-release), the 2.x will no longer appear in VS' UI; which will potentially lead to other developers adding it to their MVC 3 projects; and deny them easy access to any future upgrades to the older v2.x library without using the console).
In a couple of other cases, I've changed the package id to include a version i.e. Acme.Mvc.3 so the new and old can sit side by side. Only problem with that is that it's then possible for someone to try and include both! There's also the slightly pedantic issue that to call that v3.x is not necessarily correct; because it's a new package.
Also, I really need to be able to maintain both streams. I can rely on Binding Redirects in MVC 4 sites that still reference the version of the library that targets MVC 3; since none of my extensions rely on stuff that's gone.
When I look at the public nuget feeds; I rarely ever see this practise of sticking a major version in the package ID, but is there really any alternative?
There are many existing packages that uses the MVC version as part of their naming convention to differentiate between supported versions :
WindowsAzure.WebRole.MVC3
Unity.Mvc3
Spark.Web.Mvc2
Spark.Web.Mvc3
...
"Only problem with that is that it's then possible for someone to try and include both!"
I wouldn't bother trying to block this case, it would seem obvious by the name of the package that both are not meant to be side-by-side.

CodeIgniter version 2.0 is stable enough to use?

i want to port my application to CodeIgniter but i am wondering whether i should use their v2.0 or v1.72 (then when they release 2.0, upgrade it).
i have never used a framework before so i don't exactly know what implies when upgrading a framework: what does it mean practically - i just move the folders and it will work? or do i have to change a lot of settings, file structure etc? could someone enlighten me about the upgrade process.
and what would you use: v.1.72 or v2.0?
if i'm using the latest version, is there a good documentation for it somewhere so you can read about how to use the new features: packages, drivers and so on.
thanks
You can read about some of the changes in 2.0 here.
I would image the upgrade process should be straightforward as long as you do not use any features that are different/removed such as plugins. Just take your models, controllers, etc and drop them into the 2.0 framework. Then regression test you whole app, fixing any problems as you see them...
If you are selling this app or making something mission critical then of course v1.7.2 is the best choice. That said I have PyroCMS running on v2.0 and since some of my bug-fixes were merged it seems stable enough.
One should consider time frames for deployment:
If it is one week, then stick to v1.7.2
If it is three months, go with v2
Assuming three months is approximately to time for a release to stabilise?

Resources