Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setup NodaTime under Asp.Net vnext

I've installed VS2015 CTP, created a vNext ConsoleApplication and would like to use NodaTime.

I've added the dependency like so:

"dependencies": {
    "NodaTime": "1.3.1"
},

The package gets restored, but when I try to compile the solution, a warning arises:

Type NodaTime.Instant exists in the package: NodaTime 1.3.1, Supported frameworks: .NETFramework 3.5-Client;.NETPortable-net40+sl50+win+wpa81+wp80+MonoAndroid10+MonoTouch10+xamarinios10

The type is then simply not found by the compiler, telling me:

The type or namespace name 'NodaTime' could not be found (are you missing a using directive or an assembly reference?)

Any ideas on how to fix that? Could I also just add it as an dependency of the framework that it exists for?

like image 345
Kjellski Avatar asked Nov 19 '25 06:11

Kjellski


1 Answers

Most existing packages will not support ASP.NET Core 5 yet; because of the significant differences, they need to be manually updated. If you're wanting to use NodaTime, you'll either need to stick to ASP.NET 5 (not Core) or wait for Jon Skeet to release a Core version.

ASP.NET 5 (not Core) will still let you use all the new functionality, though... except not cross platform.

like image 149
Matt DeKrey Avatar answered Nov 21 '25 23:11

Matt DeKrey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!