'IServiceCollection' does not contain a definition for 'AddSession'










7














I am getting an error while adding 'AddSession' in ASP.Net Core 1.1 using VS2017.




'IServiceCollection' does not contain a definition for 'AddSession'
and no extension method 'AddSession' accepting a first argument of
type 'IServiceCollection' could be found (are you missing a using
directive or an assembly reference?)




.csproj



<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Session" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.0" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference
Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" />
</ItemGroup>

</Project>


Error :



enter image description here










share|improve this question























  • Building seems to work fine. Visual Studio might just be off here, did you try to restart it?
    – Henk Mollema
    Jun 7 '17 at 10:10










  • @HenkMollema Yes, It's throwing the same issue.
    – RajeeshMenoth
    Jun 7 '17 at 10:12










  • Well-known problem. Try stackoverflow.com/a/43562917/5112433
    – Ilya Chumakov
    Jun 7 '17 at 13:18










  • Now it's working !! I just restarted my machine.
    – RajeeshMenoth
    Jun 10 '17 at 8:24










  • @llya Chumakov well known yet ignored by microsoft
    – JSON
    Nov 2 at 15:39















7














I am getting an error while adding 'AddSession' in ASP.Net Core 1.1 using VS2017.




'IServiceCollection' does not contain a definition for 'AddSession'
and no extension method 'AddSession' accepting a first argument of
type 'IServiceCollection' could be found (are you missing a using
directive or an assembly reference?)




.csproj



<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Session" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.0" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference
Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" />
</ItemGroup>

</Project>


Error :



enter image description here










share|improve this question























  • Building seems to work fine. Visual Studio might just be off here, did you try to restart it?
    – Henk Mollema
    Jun 7 '17 at 10:10










  • @HenkMollema Yes, It's throwing the same issue.
    – RajeeshMenoth
    Jun 7 '17 at 10:12










  • Well-known problem. Try stackoverflow.com/a/43562917/5112433
    – Ilya Chumakov
    Jun 7 '17 at 13:18










  • Now it's working !! I just restarted my machine.
    – RajeeshMenoth
    Jun 10 '17 at 8:24










  • @llya Chumakov well known yet ignored by microsoft
    – JSON
    Nov 2 at 15:39













7












7








7


2





I am getting an error while adding 'AddSession' in ASP.Net Core 1.1 using VS2017.




'IServiceCollection' does not contain a definition for 'AddSession'
and no extension method 'AddSession' accepting a first argument of
type 'IServiceCollection' could be found (are you missing a using
directive or an assembly reference?)




.csproj



<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Session" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.0" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference
Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" />
</ItemGroup>

</Project>


Error :



enter image description here










share|improve this question















I am getting an error while adding 'AddSession' in ASP.Net Core 1.1 using VS2017.




'IServiceCollection' does not contain a definition for 'AddSession'
and no extension method 'AddSession' accepting a first argument of
type 'IServiceCollection' could be found (are you missing a using
directive or an assembly reference?)




.csproj



<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Session" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.0" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference
Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" />
</ItemGroup>

</Project>


Error :



enter image description here







session asp.net-core asp.net-core-1.0 asp.net-core-1.1 visual-studio-2017






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 29 at 12:21

























asked Jun 7 '17 at 10:03









RajeeshMenoth

74011024




74011024











  • Building seems to work fine. Visual Studio might just be off here, did you try to restart it?
    – Henk Mollema
    Jun 7 '17 at 10:10










  • @HenkMollema Yes, It's throwing the same issue.
    – RajeeshMenoth
    Jun 7 '17 at 10:12










  • Well-known problem. Try stackoverflow.com/a/43562917/5112433
    – Ilya Chumakov
    Jun 7 '17 at 13:18










  • Now it's working !! I just restarted my machine.
    – RajeeshMenoth
    Jun 10 '17 at 8:24










  • @llya Chumakov well known yet ignored by microsoft
    – JSON
    Nov 2 at 15:39
















  • Building seems to work fine. Visual Studio might just be off here, did you try to restart it?
    – Henk Mollema
    Jun 7 '17 at 10:10










  • @HenkMollema Yes, It's throwing the same issue.
    – RajeeshMenoth
    Jun 7 '17 at 10:12










  • Well-known problem. Try stackoverflow.com/a/43562917/5112433
    – Ilya Chumakov
    Jun 7 '17 at 13:18










  • Now it's working !! I just restarted my machine.
    – RajeeshMenoth
    Jun 10 '17 at 8:24










  • @llya Chumakov well known yet ignored by microsoft
    – JSON
    Nov 2 at 15:39















Building seems to work fine. Visual Studio might just be off here, did you try to restart it?
– Henk Mollema
Jun 7 '17 at 10:10




Building seems to work fine. Visual Studio might just be off here, did you try to restart it?
– Henk Mollema
Jun 7 '17 at 10:10












@HenkMollema Yes, It's throwing the same issue.
– RajeeshMenoth
Jun 7 '17 at 10:12




@HenkMollema Yes, It's throwing the same issue.
– RajeeshMenoth
Jun 7 '17 at 10:12












Well-known problem. Try stackoverflow.com/a/43562917/5112433
– Ilya Chumakov
Jun 7 '17 at 13:18




Well-known problem. Try stackoverflow.com/a/43562917/5112433
– Ilya Chumakov
Jun 7 '17 at 13:18












Now it's working !! I just restarted my machine.
– RajeeshMenoth
Jun 10 '17 at 8:24




Now it's working !! I just restarted my machine.
– RajeeshMenoth
Jun 10 '17 at 8:24












@llya Chumakov well known yet ignored by microsoft
– JSON
Nov 2 at 15:39




@llya Chumakov well known yet ignored by microsoft
– JSON
Nov 2 at 15:39












7 Answers
7






active

oldest

votes


















11














You need to include following Nuget package




AutoMapper.Extensions.Microsoft.Dependencyinjection







share|improve this answer




























    5














    I know this is a bit late, but did you try to install the Microsoft.AspNetCore.Session package from nuget?



    https://www.nuget.org/packages/Microsoft.AspNetCore.Session/



    In Visual Studio:
    Install-Package Microsoft.AspNetCore.Session -Version 1.1.2(in my case)



    It worked for me!






    share|improve this answer




















    • The package is already installed in the project and that you can see in my given .csproj code. Any how everything working fine and this is not an answer for me.
      – RajeeshMenoth
      Dec 14 '17 at 7:27






    • 1




      thanks. it works
      – Fityan Aula
      Feb 17 at 2:21






    • 1




      This worked for me as well.
      – Sibeesh Venu
      Apr 4 at 16:15






    • 1




      worked for me. f'n microsoft
      – JSON
      Nov 2 at 15:45


















    2














    The following way I fixed the Issue.



    1. Clean and Rebuild the solution.

    2. Restart Visual Studio 2017.

    Thanks @HenkMollema






    share|improve this answer




























      1














      The versions of the dependencies seem to be out of sync. Use Nuget to update all your packages to be the same version and that should solve the issue. This applies to most if not all Microsoft.* packages.



      Also you need the following using statements:



      using Microsoft.AspNetCore.Builder;
      using Microsoft.Extensions.DependencyInjection;
      using System;





      share|improve this answer






















      • Which version we can prefer for all dependencies ?
        – RajeeshMenoth
        Jun 7 '17 at 10:29










      • There is a list of reccomended versions here: nuget.org/packages/Microsoft.AspNetCore
        – Stephen Wilson
        Jun 7 '17 at 10:32










      • I changed to 1.1.2 but no use.
        – RajeeshMenoth
        Jun 7 '17 at 10:36










      • It's downloaded and the versions are now 1.1.2. I also done 'Clean' and 'Rebuild' but still I am facing the same Issue.
        – RajeeshMenoth
        Jun 7 '17 at 10:54










      • Yes, Three more using statements in my class using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging;
        – RajeeshMenoth
        Jun 7 '17 at 11:06


















      1














      Make sure you have



      <PackageReference Include="Microsoft.AspNetCore.Session" Vesion="1.1.1" />


      (or more up-to-date version) within your .csproj file






      share|improve this answer




















      • To much late buddy !
        – RajeeshMenoth
        Dec 21 '17 at 4:18










      • This is meant for others who come across this post with a similar error, but different root cause. If rebooting was the fix, I would suggest deleting this question/answer as it is probably of limited use to others
        – coolhand
        Dec 26 '17 at 21:36











      • Whenever people posting any questions in SO , they will mention the exact reason of the bug. Question 4 U , "Session" package already existing in the given code then why are you trying to downgrade the package version without any reason ?.
        – RajeeshMenoth
        Dec 28 '17 at 10:33










      • I'm not, that's why i put the parenthetical comment
        – coolhand
        Dec 28 '17 at 14:21


















      0














      In my case AutoMapper.Extensions.Microsoft.DependencyInjection (v1 was installed). Uninstalled and installed AutoMapper.Extensions.Microsoft.DependencyInjection v5.0.1






      share|improve this answer




























        -1














        Adding the nuget package for Scrutor fixed it for me






        share|improve this answer






















        • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
          – Mozahler
          Nov 5 at 18:48










        • ok just removed it
          – zlopez119
          Nov 5 at 20:53










        Your Answer






        StackExchange.ifUsing("editor", function ()
        StackExchange.using("externalEditor", function ()
        StackExchange.using("snippets", function ()
        StackExchange.snippets.init();
        );
        );
        , "code-snippets");

        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "1"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44409554%2fiservicecollection-does-not-contain-a-definition-for-addsession%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        7 Answers
        7






        active

        oldest

        votes








        7 Answers
        7






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        11














        You need to include following Nuget package




        AutoMapper.Extensions.Microsoft.Dependencyinjection







        share|improve this answer

























          11














          You need to include following Nuget package




          AutoMapper.Extensions.Microsoft.Dependencyinjection







          share|improve this answer























            11












            11








            11






            You need to include following Nuget package




            AutoMapper.Extensions.Microsoft.Dependencyinjection







            share|improve this answer












            You need to include following Nuget package




            AutoMapper.Extensions.Microsoft.Dependencyinjection








            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered May 17 at 16:33









            Neeraj Kumar

            1,85811629




            1,85811629























                5














                I know this is a bit late, but did you try to install the Microsoft.AspNetCore.Session package from nuget?



                https://www.nuget.org/packages/Microsoft.AspNetCore.Session/



                In Visual Studio:
                Install-Package Microsoft.AspNetCore.Session -Version 1.1.2(in my case)



                It worked for me!






                share|improve this answer




















                • The package is already installed in the project and that you can see in my given .csproj code. Any how everything working fine and this is not an answer for me.
                  – RajeeshMenoth
                  Dec 14 '17 at 7:27






                • 1




                  thanks. it works
                  – Fityan Aula
                  Feb 17 at 2:21






                • 1




                  This worked for me as well.
                  – Sibeesh Venu
                  Apr 4 at 16:15






                • 1




                  worked for me. f'n microsoft
                  – JSON
                  Nov 2 at 15:45















                5














                I know this is a bit late, but did you try to install the Microsoft.AspNetCore.Session package from nuget?



                https://www.nuget.org/packages/Microsoft.AspNetCore.Session/



                In Visual Studio:
                Install-Package Microsoft.AspNetCore.Session -Version 1.1.2(in my case)



                It worked for me!






                share|improve this answer




















                • The package is already installed in the project and that you can see in my given .csproj code. Any how everything working fine and this is not an answer for me.
                  – RajeeshMenoth
                  Dec 14 '17 at 7:27






                • 1




                  thanks. it works
                  – Fityan Aula
                  Feb 17 at 2:21






                • 1




                  This worked for me as well.
                  – Sibeesh Venu
                  Apr 4 at 16:15






                • 1




                  worked for me. f'n microsoft
                  – JSON
                  Nov 2 at 15:45













                5












                5








                5






                I know this is a bit late, but did you try to install the Microsoft.AspNetCore.Session package from nuget?



                https://www.nuget.org/packages/Microsoft.AspNetCore.Session/



                In Visual Studio:
                Install-Package Microsoft.AspNetCore.Session -Version 1.1.2(in my case)



                It worked for me!






                share|improve this answer












                I know this is a bit late, but did you try to install the Microsoft.AspNetCore.Session package from nuget?



                https://www.nuget.org/packages/Microsoft.AspNetCore.Session/



                In Visual Studio:
                Install-Package Microsoft.AspNetCore.Session -Version 1.1.2(in my case)



                It worked for me!







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 6 '17 at 9:34









                Lewis86

                392514




                392514











                • The package is already installed in the project and that you can see in my given .csproj code. Any how everything working fine and this is not an answer for me.
                  – RajeeshMenoth
                  Dec 14 '17 at 7:27






                • 1




                  thanks. it works
                  – Fityan Aula
                  Feb 17 at 2:21






                • 1




                  This worked for me as well.
                  – Sibeesh Venu
                  Apr 4 at 16:15






                • 1




                  worked for me. f'n microsoft
                  – JSON
                  Nov 2 at 15:45
















                • The package is already installed in the project and that you can see in my given .csproj code. Any how everything working fine and this is not an answer for me.
                  – RajeeshMenoth
                  Dec 14 '17 at 7:27






                • 1




                  thanks. it works
                  – Fityan Aula
                  Feb 17 at 2:21






                • 1




                  This worked for me as well.
                  – Sibeesh Venu
                  Apr 4 at 16:15






                • 1




                  worked for me. f'n microsoft
                  – JSON
                  Nov 2 at 15:45















                The package is already installed in the project and that you can see in my given .csproj code. Any how everything working fine and this is not an answer for me.
                – RajeeshMenoth
                Dec 14 '17 at 7:27




                The package is already installed in the project and that you can see in my given .csproj code. Any how everything working fine and this is not an answer for me.
                – RajeeshMenoth
                Dec 14 '17 at 7:27




                1




                1




                thanks. it works
                – Fityan Aula
                Feb 17 at 2:21




                thanks. it works
                – Fityan Aula
                Feb 17 at 2:21




                1




                1




                This worked for me as well.
                – Sibeesh Venu
                Apr 4 at 16:15




                This worked for me as well.
                – Sibeesh Venu
                Apr 4 at 16:15




                1




                1




                worked for me. f'n microsoft
                – JSON
                Nov 2 at 15:45




                worked for me. f'n microsoft
                – JSON
                Nov 2 at 15:45











                2














                The following way I fixed the Issue.



                1. Clean and Rebuild the solution.

                2. Restart Visual Studio 2017.

                Thanks @HenkMollema






                share|improve this answer

























                  2














                  The following way I fixed the Issue.



                  1. Clean and Rebuild the solution.

                  2. Restart Visual Studio 2017.

                  Thanks @HenkMollema






                  share|improve this answer























                    2












                    2








                    2






                    The following way I fixed the Issue.



                    1. Clean and Rebuild the solution.

                    2. Restart Visual Studio 2017.

                    Thanks @HenkMollema






                    share|improve this answer












                    The following way I fixed the Issue.



                    1. Clean and Rebuild the solution.

                    2. Restart Visual Studio 2017.

                    Thanks @HenkMollema







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jun 10 '17 at 8:29









                    RajeeshMenoth

                    74011024




                    74011024





















                        1














                        The versions of the dependencies seem to be out of sync. Use Nuget to update all your packages to be the same version and that should solve the issue. This applies to most if not all Microsoft.* packages.



                        Also you need the following using statements:



                        using Microsoft.AspNetCore.Builder;
                        using Microsoft.Extensions.DependencyInjection;
                        using System;





                        share|improve this answer






















                        • Which version we can prefer for all dependencies ?
                          – RajeeshMenoth
                          Jun 7 '17 at 10:29










                        • There is a list of reccomended versions here: nuget.org/packages/Microsoft.AspNetCore
                          – Stephen Wilson
                          Jun 7 '17 at 10:32










                        • I changed to 1.1.2 but no use.
                          – RajeeshMenoth
                          Jun 7 '17 at 10:36










                        • It's downloaded and the versions are now 1.1.2. I also done 'Clean' and 'Rebuild' but still I am facing the same Issue.
                          – RajeeshMenoth
                          Jun 7 '17 at 10:54










                        • Yes, Three more using statements in my class using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging;
                          – RajeeshMenoth
                          Jun 7 '17 at 11:06















                        1














                        The versions of the dependencies seem to be out of sync. Use Nuget to update all your packages to be the same version and that should solve the issue. This applies to most if not all Microsoft.* packages.



                        Also you need the following using statements:



                        using Microsoft.AspNetCore.Builder;
                        using Microsoft.Extensions.DependencyInjection;
                        using System;





                        share|improve this answer






















                        • Which version we can prefer for all dependencies ?
                          – RajeeshMenoth
                          Jun 7 '17 at 10:29










                        • There is a list of reccomended versions here: nuget.org/packages/Microsoft.AspNetCore
                          – Stephen Wilson
                          Jun 7 '17 at 10:32










                        • I changed to 1.1.2 but no use.
                          – RajeeshMenoth
                          Jun 7 '17 at 10:36










                        • It's downloaded and the versions are now 1.1.2. I also done 'Clean' and 'Rebuild' but still I am facing the same Issue.
                          – RajeeshMenoth
                          Jun 7 '17 at 10:54










                        • Yes, Three more using statements in my class using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging;
                          – RajeeshMenoth
                          Jun 7 '17 at 11:06













                        1












                        1








                        1






                        The versions of the dependencies seem to be out of sync. Use Nuget to update all your packages to be the same version and that should solve the issue. This applies to most if not all Microsoft.* packages.



                        Also you need the following using statements:



                        using Microsoft.AspNetCore.Builder;
                        using Microsoft.Extensions.DependencyInjection;
                        using System;





                        share|improve this answer














                        The versions of the dependencies seem to be out of sync. Use Nuget to update all your packages to be the same version and that should solve the issue. This applies to most if not all Microsoft.* packages.



                        Also you need the following using statements:



                        using Microsoft.AspNetCore.Builder;
                        using Microsoft.Extensions.DependencyInjection;
                        using System;






                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited Jun 7 '17 at 11:02

























                        answered Jun 7 '17 at 10:24









                        Stephen Wilson

                        1,0651326




                        1,0651326











                        • Which version we can prefer for all dependencies ?
                          – RajeeshMenoth
                          Jun 7 '17 at 10:29










                        • There is a list of reccomended versions here: nuget.org/packages/Microsoft.AspNetCore
                          – Stephen Wilson
                          Jun 7 '17 at 10:32










                        • I changed to 1.1.2 but no use.
                          – RajeeshMenoth
                          Jun 7 '17 at 10:36










                        • It's downloaded and the versions are now 1.1.2. I also done 'Clean' and 'Rebuild' but still I am facing the same Issue.
                          – RajeeshMenoth
                          Jun 7 '17 at 10:54










                        • Yes, Three more using statements in my class using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging;
                          – RajeeshMenoth
                          Jun 7 '17 at 11:06
















                        • Which version we can prefer for all dependencies ?
                          – RajeeshMenoth
                          Jun 7 '17 at 10:29










                        • There is a list of reccomended versions here: nuget.org/packages/Microsoft.AspNetCore
                          – Stephen Wilson
                          Jun 7 '17 at 10:32










                        • I changed to 1.1.2 but no use.
                          – RajeeshMenoth
                          Jun 7 '17 at 10:36










                        • It's downloaded and the versions are now 1.1.2. I also done 'Clean' and 'Rebuild' but still I am facing the same Issue.
                          – RajeeshMenoth
                          Jun 7 '17 at 10:54










                        • Yes, Three more using statements in my class using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging;
                          – RajeeshMenoth
                          Jun 7 '17 at 11:06















                        Which version we can prefer for all dependencies ?
                        – RajeeshMenoth
                        Jun 7 '17 at 10:29




                        Which version we can prefer for all dependencies ?
                        – RajeeshMenoth
                        Jun 7 '17 at 10:29












                        There is a list of reccomended versions here: nuget.org/packages/Microsoft.AspNetCore
                        – Stephen Wilson
                        Jun 7 '17 at 10:32




                        There is a list of reccomended versions here: nuget.org/packages/Microsoft.AspNetCore
                        – Stephen Wilson
                        Jun 7 '17 at 10:32












                        I changed to 1.1.2 but no use.
                        – RajeeshMenoth
                        Jun 7 '17 at 10:36




                        I changed to 1.1.2 but no use.
                        – RajeeshMenoth
                        Jun 7 '17 at 10:36












                        It's downloaded and the versions are now 1.1.2. I also done 'Clean' and 'Rebuild' but still I am facing the same Issue.
                        – RajeeshMenoth
                        Jun 7 '17 at 10:54




                        It's downloaded and the versions are now 1.1.2. I also done 'Clean' and 'Rebuild' but still I am facing the same Issue.
                        – RajeeshMenoth
                        Jun 7 '17 at 10:54












                        Yes, Three more using statements in my class using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging;
                        – RajeeshMenoth
                        Jun 7 '17 at 11:06




                        Yes, Three more using statements in my class using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging;
                        – RajeeshMenoth
                        Jun 7 '17 at 11:06











                        1














                        Make sure you have



                        <PackageReference Include="Microsoft.AspNetCore.Session" Vesion="1.1.1" />


                        (or more up-to-date version) within your .csproj file






                        share|improve this answer




















                        • To much late buddy !
                          – RajeeshMenoth
                          Dec 21 '17 at 4:18










                        • This is meant for others who come across this post with a similar error, but different root cause. If rebooting was the fix, I would suggest deleting this question/answer as it is probably of limited use to others
                          – coolhand
                          Dec 26 '17 at 21:36











                        • Whenever people posting any questions in SO , they will mention the exact reason of the bug. Question 4 U , "Session" package already existing in the given code then why are you trying to downgrade the package version without any reason ?.
                          – RajeeshMenoth
                          Dec 28 '17 at 10:33










                        • I'm not, that's why i put the parenthetical comment
                          – coolhand
                          Dec 28 '17 at 14:21















                        1














                        Make sure you have



                        <PackageReference Include="Microsoft.AspNetCore.Session" Vesion="1.1.1" />


                        (or more up-to-date version) within your .csproj file






                        share|improve this answer




















                        • To much late buddy !
                          – RajeeshMenoth
                          Dec 21 '17 at 4:18










                        • This is meant for others who come across this post with a similar error, but different root cause. If rebooting was the fix, I would suggest deleting this question/answer as it is probably of limited use to others
                          – coolhand
                          Dec 26 '17 at 21:36











                        • Whenever people posting any questions in SO , they will mention the exact reason of the bug. Question 4 U , "Session" package already existing in the given code then why are you trying to downgrade the package version without any reason ?.
                          – RajeeshMenoth
                          Dec 28 '17 at 10:33










                        • I'm not, that's why i put the parenthetical comment
                          – coolhand
                          Dec 28 '17 at 14:21













                        1












                        1








                        1






                        Make sure you have



                        <PackageReference Include="Microsoft.AspNetCore.Session" Vesion="1.1.1" />


                        (or more up-to-date version) within your .csproj file






                        share|improve this answer












                        Make sure you have



                        <PackageReference Include="Microsoft.AspNetCore.Session" Vesion="1.1.1" />


                        (or more up-to-date version) within your .csproj file







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Dec 19 '17 at 17:51









                        coolhand

                        404216




                        404216











                        • To much late buddy !
                          – RajeeshMenoth
                          Dec 21 '17 at 4:18










                        • This is meant for others who come across this post with a similar error, but different root cause. If rebooting was the fix, I would suggest deleting this question/answer as it is probably of limited use to others
                          – coolhand
                          Dec 26 '17 at 21:36











                        • Whenever people posting any questions in SO , they will mention the exact reason of the bug. Question 4 U , "Session" package already existing in the given code then why are you trying to downgrade the package version without any reason ?.
                          – RajeeshMenoth
                          Dec 28 '17 at 10:33










                        • I'm not, that's why i put the parenthetical comment
                          – coolhand
                          Dec 28 '17 at 14:21
















                        • To much late buddy !
                          – RajeeshMenoth
                          Dec 21 '17 at 4:18










                        • This is meant for others who come across this post with a similar error, but different root cause. If rebooting was the fix, I would suggest deleting this question/answer as it is probably of limited use to others
                          – coolhand
                          Dec 26 '17 at 21:36











                        • Whenever people posting any questions in SO , they will mention the exact reason of the bug. Question 4 U , "Session" package already existing in the given code then why are you trying to downgrade the package version without any reason ?.
                          – RajeeshMenoth
                          Dec 28 '17 at 10:33










                        • I'm not, that's why i put the parenthetical comment
                          – coolhand
                          Dec 28 '17 at 14:21















                        To much late buddy !
                        – RajeeshMenoth
                        Dec 21 '17 at 4:18




                        To much late buddy !
                        – RajeeshMenoth
                        Dec 21 '17 at 4:18












                        This is meant for others who come across this post with a similar error, but different root cause. If rebooting was the fix, I would suggest deleting this question/answer as it is probably of limited use to others
                        – coolhand
                        Dec 26 '17 at 21:36





                        This is meant for others who come across this post with a similar error, but different root cause. If rebooting was the fix, I would suggest deleting this question/answer as it is probably of limited use to others
                        – coolhand
                        Dec 26 '17 at 21:36













                        Whenever people posting any questions in SO , they will mention the exact reason of the bug. Question 4 U , "Session" package already existing in the given code then why are you trying to downgrade the package version without any reason ?.
                        – RajeeshMenoth
                        Dec 28 '17 at 10:33




                        Whenever people posting any questions in SO , they will mention the exact reason of the bug. Question 4 U , "Session" package already existing in the given code then why are you trying to downgrade the package version without any reason ?.
                        – RajeeshMenoth
                        Dec 28 '17 at 10:33












                        I'm not, that's why i put the parenthetical comment
                        – coolhand
                        Dec 28 '17 at 14:21




                        I'm not, that's why i put the parenthetical comment
                        – coolhand
                        Dec 28 '17 at 14:21











                        0














                        In my case AutoMapper.Extensions.Microsoft.DependencyInjection (v1 was installed). Uninstalled and installed AutoMapper.Extensions.Microsoft.DependencyInjection v5.0.1






                        share|improve this answer

























                          0














                          In my case AutoMapper.Extensions.Microsoft.DependencyInjection (v1 was installed). Uninstalled and installed AutoMapper.Extensions.Microsoft.DependencyInjection v5.0.1






                          share|improve this answer























                            0












                            0








                            0






                            In my case AutoMapper.Extensions.Microsoft.DependencyInjection (v1 was installed). Uninstalled and installed AutoMapper.Extensions.Microsoft.DependencyInjection v5.0.1






                            share|improve this answer












                            In my case AutoMapper.Extensions.Microsoft.DependencyInjection (v1 was installed). Uninstalled and installed AutoMapper.Extensions.Microsoft.DependencyInjection v5.0.1







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 11 at 15:50









                            Patrick

                            1,181916




                            1,181916





















                                -1














                                Adding the nuget package for Scrutor fixed it for me






                                share|improve this answer






















                                • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
                                  – Mozahler
                                  Nov 5 at 18:48










                                • ok just removed it
                                  – zlopez119
                                  Nov 5 at 20:53















                                -1














                                Adding the nuget package for Scrutor fixed it for me






                                share|improve this answer






















                                • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
                                  – Mozahler
                                  Nov 5 at 18:48










                                • ok just removed it
                                  – zlopez119
                                  Nov 5 at 20:53













                                -1












                                -1








                                -1






                                Adding the nuget package for Scrutor fixed it for me






                                share|improve this answer














                                Adding the nuget package for Scrutor fixed it for me







                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited Nov 5 at 20:52

























                                answered Nov 5 at 16:14









                                zlopez119

                                165




                                165











                                • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
                                  – Mozahler
                                  Nov 5 at 18:48










                                • ok just removed it
                                  – zlopez119
                                  Nov 5 at 20:53
















                                • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
                                  – Mozahler
                                  Nov 5 at 18:48










                                • ok just removed it
                                  – zlopez119
                                  Nov 5 at 20:53















                                While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
                                – Mozahler
                                Nov 5 at 18:48




                                While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
                                – Mozahler
                                Nov 5 at 18:48












                                ok just removed it
                                – zlopez119
                                Nov 5 at 20:53




                                ok just removed it
                                – zlopez119
                                Nov 5 at 20:53

















                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Stack Overflow!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.





                                Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                Please pay close attention to the following guidance:


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44409554%2fiservicecollection-does-not-contain-a-definition-for-addsession%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Use pre created SQLite database for Android project in kotlin

                                Darth Vader #20

                                Ondo