'ISession' does not contain a definition for 'SetString' and no extension method 'SetString' accepting a first argument of type 'ISession' could be found (are you missing a using directive or an assembly reference?)
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Hello @Hypenate ... this topic and the sample ["samples" (plural) really, since there will be 1.x and 2.x samples] were just overhauled. The PR is in review, and the new topic should appear shortly. I'll close this as a duplicate of #5495. If you want to see the PR for the new topic where you'll find the new content in the app-state.md file, it's over here :point_right: https://github.com/aspnet/Docs/pull/7029
In the new documentation, the SetStringis still there.
Yet it is unknown to ISession.
Ok ... Thanks. I'll take a look and get back to you soon.
@Hypenate Did you add a namespace for ...
using Microsoft.AspNetCore.Http;
@guardrex I copy pasted it from the new documentation
My ISession is: Assembly Microsoft.AspNetCore.Http.Features, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
SetString is in the Microsoft.AspNetCore.Http.Extensions assembly and Microsoft.AspNetCore.Http namespace.
https://docs.microsoft.com/dotnet/api/microsoft.aspnetcore.http.sessionextensions.setstring
I added some content that will indicate more info about what the ISession extension methods are, where they are, and how to get them.
https://github.com/aspnet/Docs/pull/7029/commits/05233d952dbd9f8de856bed64f2cecfa33a79cb2
For most devs using a vanilla 2.1 project that references Microsoft.AspNetCore.App, they'll just need to have a using Microsoft.AspNetCore.Http; statement in the class file to get access to the extension methods. 🤞
I have added the NuGet _Microsoft.AspNetCore.Http.Extensions_ and then the code works!
Excellent @Hypenate. I made some further enhancements to the language in the PR to cover this issue.