Is there a ValueTask<T> in C# 7.0? - async-await

There are a few preliminary sources that mention that there is a new ValueTask in C# 7.0:
https://blogs.msdn.microsoft.com/dotnet/2016/08/24/whats-new-in-csharp-7-0/
http://intellitect.com/generalized-async-return-types/
But I am not able to find this type?

According to the documentation, System.Threading.Tasks.ValueTask<TResult> is in the System.Threading.Tasks.Extensions package.

For those still struggling to use ValueTask, the System.Threading.Tasks.Extensions Nuget package must still be installed. My system includes VS 2017 version 15.2 along with version 4.7 of the .NET Framework - and I still had to install the Nuget package.
To install the package, from VS 2017 click on the Project menu and select Manage Nuget Packages. In the search box, enter System.Threading.Tasks.Extensions and then install it. You should be good to go after this.

Related

How to update Microsoft.Bot.Builder version in bot framework composer?

Current version of my Bot is "4.15.0". How to update latest version in bot framework composer ?
It's not possible in Bot composer at the moment !!!
Open the application in Visual studio go to "Manage NuGet package" & update to the latest version.
If you're talking about the packages then there are few ways to do this.
One way is to use Visual Studio and update the version using the NuGet Manager
If you're using Visual Studio Code, like I am, there is an extension called NuGet Package Manger GUI that you can use and do it yourself.
Another possible way is to just change the version number in .csproj file

NuGet Package Manager does not install package with highest depencency version?

This must be a bug of the NuGet Package Manager I'm using (version 4.6.0). I used the option DependencyVersion highest but it always picks the lowest version for dependencies.
Like this (I'm trying to install Serilog.AspNetCore with dependencies of 2.2.0 - the latest but 2.0.0 is always picked).
install-package Serilog.AspNetCore -DependencyVersion highest
One dependency it picks is Microsoft.AspNetCore.Http.Abstractions 2.0.0 but I expected it to pick Microsoft.AspNetCore.Http.Abstractions 2.2.0.
It's important because in my project the version 2.2.0 is required, Serilog should adapt that requirement by installing with that correct version of dependencies. But here I could not do anything to help it understand what I want.
Also the Install and Update options are not shown in the UI of NuGet Package Manager (the DependencyVersion could be selected there as well when using UI to install packages). So this appears to be some bug at least in the specific version of Nuget package manager I'm using.
What could I do to solve this issue? Can I try fixing the installed nuget manager (there is not any update in the Updates window). Thanks!
UPDATE
I've just tried a traditional .NET project, it works. But the problem raised when my projects target .NET Core (ASP.NET Core)? Looks like it does not support that feature for .NET Core projects?
The DependencyVersion switch is something used to control the behavior when NuGet looks for patch versions. It seems to be introduced after NuGet 2.8, but one point we should know is this option only supports packages.config format.
There are two package management formats:Projects.config and PackageReference.
1.For traditional .net project:It can use Packages.config or PackageReference to manage its nuget packages.But by default it uses packages.config.
2.For .net core projects(which uses new SDK-format project file):It uses new PackageReference format as its Package Management format.
More details about it see: Project Type Support
And someone had post this feature request in github, see the issue here.Hope it helps.
Update:
I expected it to pick Microsoft.AspNetCore.Http.Abstractions 2.2.0
Trying deleting the bin and obj folder first,
Then go Tools menu=>Nuget Package Manager=>Package Manager Settings=>Clear All Nuget Caches.(Sometimes it will delete the packages folder in C:\Users\lancel\.nuget\packages, we need to manually create a new packages folder)
Then install the Microsoft.AspNetCore.Http.Abstractions 2.2.0 package separately before installing the Serilog.AspNetCore package. Builds the application and you can check the output .dll by setting the CopyLocalLockFileAssemblies. In my machine it references 2.2.0 version of Microsoft.AspNetCore.Http.Abstractions.dll successfully. Hope it helps:)

What is the aspnet50 target framework, and can I reference it from VS2013?

The packages at https://www.myget.org/gallery/aspnetrelease target aspnet50, and when I try to install them I get:
You are trying to install this package into a project that targets
'.NETFramework,Version=v4.5', but the package does not contain any
assembly references or content files that are compatible with that
framework.
Is there a way?
You can't do that (currently). If you insist on working with ASP.NET vNext in VS2013, you can use it as an editor and run everything from the commandline with the tools from the aspnet Home repository.
You should install the newest CTP of VS14 if you want to work with asp.net vNext, which you can download the newest version of from here and learn how to use it in this guide. ASP.NET vNext is in alpha currently, so documentation and information can be a bit sparse. aspnet50 is the (current) name for the new .Net framework introduced with ASP.NET vNext.
I was able to manually download the nuget packages and had no problem referencing from VS 2013.

NuGet Package Manager errors when trying to update

Opening VS2010 today, the extension manager notified me of an update for NuGet Package Manager.
During the install, I get an 'Installation Failed' with an option to view the log.
The key error message I see in that log file is:
The signature on the update version of 'NuGet Package Manager' does not match
the signature on the installed version. Therefore, Extension Manager cannot
install the update.
The version numbers I am upgrading from/to are as follows.
Current Version: 1.5.20902.9026
New Version: 1.6.21205.9031
I have also tried to install it while VS2010 is closed via this page:
here
Update: The recently released NuGet 2.0 also may require uninstalling an older version of NuGet first.
From the NuGet 2.0 Release Notes: (http://docs.nuget.org/docs/release-notes/nuget-2.0)
Known Installation Issue
If you are running VS 2010 SP1, you might run into an installation error when attempting to upgrade NuGet if you have an older version installed.
The workaround is to simply uninstall NuGet and then install it from the VS Extension Gallery. See http://support.microsoft.com/kb/2581019 for more information, or to go directly to the VS hotfix.
Note: If Visual Studio won't allow you to uninstall the extension (the Uninstall button is disabled), then you likely need to restart Visual Studio using "Run as Administrator."
Here is the VisualStudio/Express hotfix for this issue...
http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=38654
There's not much on the page describing what it's for, but it's linked to from here that does provide some description...
http://connect.microsoft.com/VisualStudio/Downloads
I have installed this hotfix on both the Professional (on Win 7 Pro 32 bit) and Express versions (on Windows 7 Ultimate 64 bit) and the NuGet update behaves as it should.
When i originally had the problem, Joe Doyle's answer solved it.
However, going to version 1.8, I cannot see a listing for nuget in Programs and Features.
So from within Visual Studio / Tools / Extension Manager.
Uninstalled NUGET.
Restarted VS
Return to the Extension manager and install NUGET.
After uninstalling Nuget from Control panel, Go to C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft Corporation\NuGet Package Manager\ or the location matching similar pattern based upon windows bit version, and delete the folder 1.0.11220.104. And, if you install it now, you wont' get the same problem.

IronRuby 1.3.1 VS 2010 SP1 Installation Issue

I've downloaded the latest release of IronRuby from codeplex and ran the install with no issues.
However when I come to create a project i receive the message:
IronRuby installation not found. Although basic scripts should work standard libraries and gems won't be available....."
This seems to be an issue with vs2010 sp1 from the project issue tracker on codeplex, but theres no fix mentioned there. I only really wanted this release for the tools support so using 1.0 is something I want to avoid.
Has anyone got any workrounds/fixes/advice?
I used NuGet to install IronRuby. When I did so, it automatically added the references for me.
Go to Tools -> Library Package Manager -> Package Manager Console.
Type Install-Package ironruby
Viola!
EDIT: If you look here, they have a link where the bug is discussed.

Resources