Force evaluate floating version packages with lock file via MsBuild / csproj











up vote
0
down vote

favorite












I want to use the Locking dependencies of Nuget (>= 4.9), so I can have automatic package update during dev phase and fixed version during release build.



I enabled the lock file mode, so I now have a packages.lock.json file.



The problem is that when I have floating version of package references in the project file like:



<PackageReference Include="My.Nuget.Package" Version="1.0.*" />


The restore package via Visual Studio Build does not update to new packages version anymore. This behavior appeared after I activated the lock file.



The Microsoft documentation describes the --force-evaluate option with dotnet.exe, that works well but I want to do this directly with an MsBuild option in the csproj.



By checking the NuGet Client code, it seems that a RestoreForceEvaluate option exists in Msbuild NuGet.targets but I have no idea how to use it.










share|improve this question


























    up vote
    0
    down vote

    favorite












    I want to use the Locking dependencies of Nuget (>= 4.9), so I can have automatic package update during dev phase and fixed version during release build.



    I enabled the lock file mode, so I now have a packages.lock.json file.



    The problem is that when I have floating version of package references in the project file like:



    <PackageReference Include="My.Nuget.Package" Version="1.0.*" />


    The restore package via Visual Studio Build does not update to new packages version anymore. This behavior appeared after I activated the lock file.



    The Microsoft documentation describes the --force-evaluate option with dotnet.exe, that works well but I want to do this directly with an MsBuild option in the csproj.



    By checking the NuGet Client code, it seems that a RestoreForceEvaluate option exists in Msbuild NuGet.targets but I have no idea how to use it.










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I want to use the Locking dependencies of Nuget (>= 4.9), so I can have automatic package update during dev phase and fixed version during release build.



      I enabled the lock file mode, so I now have a packages.lock.json file.



      The problem is that when I have floating version of package references in the project file like:



      <PackageReference Include="My.Nuget.Package" Version="1.0.*" />


      The restore package via Visual Studio Build does not update to new packages version anymore. This behavior appeared after I activated the lock file.



      The Microsoft documentation describes the --force-evaluate option with dotnet.exe, that works well but I want to do this directly with an MsBuild option in the csproj.



      By checking the NuGet Client code, it seems that a RestoreForceEvaluate option exists in Msbuild NuGet.targets but I have no idea how to use it.










      share|improve this question













      I want to use the Locking dependencies of Nuget (>= 4.9), so I can have automatic package update during dev phase and fixed version during release build.



      I enabled the lock file mode, so I now have a packages.lock.json file.



      The problem is that when I have floating version of package references in the project file like:



      <PackageReference Include="My.Nuget.Package" Version="1.0.*" />


      The restore package via Visual Studio Build does not update to new packages version anymore. This behavior appeared after I activated the lock file.



      The Microsoft documentation describes the --force-evaluate option with dotnet.exe, that works well but I want to do this directly with an MsBuild option in the csproj.



      By checking the NuGet Client code, it seems that a RestoreForceEvaluate option exists in Msbuild NuGet.targets but I have no idea how to use it.







      c# visual-studio msbuild nuget






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 21 at 8:37









      maxence51

      1791111




      1791111
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted











          By checking the NuGet Client code, it seems that a RestoreForceEvaluate option exists in Msbuild NuGet.targets but I have no idea how to use it.




          I am afraid we could not do that at this moment. According to the nuget wiki,



          Enable repeatable package restore using lock file:



          enter image description here



          There is no such MSBuild equivalent option for option --force-evaluate, so we could not use --force-evaluate directly with an MsBuild option in the csproj.



          Hope this helps.






          share|improve this answer



















          • 1




            Thanks, but where is Re-evaluate and Restore?
            – maxence51
            Nov 21 at 12:27










          • @maxence51, This is a preparing feature. It will appear on a later version. I am sorry that I mentioned it too early, I have updated the answer. I hope this does not bring you too much trouble.
            – Leo Liu-MSFT
            Nov 22 at 1:31








          • 1




            Ok thank you Leo, I will deal with the CLI until this will appears in Visual Studio.
            – maxence51
            Nov 22 at 7:38










          • @maxence51, You are always welcome! :)
            – Leo Liu-MSFT
            Nov 22 at 7:39











          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',
          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%2f53408075%2fforce-evaluate-floating-version-packages-with-lock-file-via-msbuild-csproj%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted











          By checking the NuGet Client code, it seems that a RestoreForceEvaluate option exists in Msbuild NuGet.targets but I have no idea how to use it.




          I am afraid we could not do that at this moment. According to the nuget wiki,



          Enable repeatable package restore using lock file:



          enter image description here



          There is no such MSBuild equivalent option for option --force-evaluate, so we could not use --force-evaluate directly with an MsBuild option in the csproj.



          Hope this helps.






          share|improve this answer



















          • 1




            Thanks, but where is Re-evaluate and Restore?
            – maxence51
            Nov 21 at 12:27










          • @maxence51, This is a preparing feature. It will appear on a later version. I am sorry that I mentioned it too early, I have updated the answer. I hope this does not bring you too much trouble.
            – Leo Liu-MSFT
            Nov 22 at 1:31








          • 1




            Ok thank you Leo, I will deal with the CLI until this will appears in Visual Studio.
            – maxence51
            Nov 22 at 7:38










          • @maxence51, You are always welcome! :)
            – Leo Liu-MSFT
            Nov 22 at 7:39















          up vote
          1
          down vote



          accepted











          By checking the NuGet Client code, it seems that a RestoreForceEvaluate option exists in Msbuild NuGet.targets but I have no idea how to use it.




          I am afraid we could not do that at this moment. According to the nuget wiki,



          Enable repeatable package restore using lock file:



          enter image description here



          There is no such MSBuild equivalent option for option --force-evaluate, so we could not use --force-evaluate directly with an MsBuild option in the csproj.



          Hope this helps.






          share|improve this answer



















          • 1




            Thanks, but where is Re-evaluate and Restore?
            – maxence51
            Nov 21 at 12:27










          • @maxence51, This is a preparing feature. It will appear on a later version. I am sorry that I mentioned it too early, I have updated the answer. I hope this does not bring you too much trouble.
            – Leo Liu-MSFT
            Nov 22 at 1:31








          • 1




            Ok thank you Leo, I will deal with the CLI until this will appears in Visual Studio.
            – maxence51
            Nov 22 at 7:38










          • @maxence51, You are always welcome! :)
            – Leo Liu-MSFT
            Nov 22 at 7:39













          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted







          By checking the NuGet Client code, it seems that a RestoreForceEvaluate option exists in Msbuild NuGet.targets but I have no idea how to use it.




          I am afraid we could not do that at this moment. According to the nuget wiki,



          Enable repeatable package restore using lock file:



          enter image description here



          There is no such MSBuild equivalent option for option --force-evaluate, so we could not use --force-evaluate directly with an MsBuild option in the csproj.



          Hope this helps.






          share|improve this answer















          By checking the NuGet Client code, it seems that a RestoreForceEvaluate option exists in Msbuild NuGet.targets but I have no idea how to use it.




          I am afraid we could not do that at this moment. According to the nuget wiki,



          Enable repeatable package restore using lock file:



          enter image description here



          There is no such MSBuild equivalent option for option --force-evaluate, so we could not use --force-evaluate directly with an MsBuild option in the csproj.



          Hope this helps.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 22 at 1:25

























          answered Nov 21 at 9:54









          Leo Liu-MSFT

          16.8k21731




          16.8k21731








          • 1




            Thanks, but where is Re-evaluate and Restore?
            – maxence51
            Nov 21 at 12:27










          • @maxence51, This is a preparing feature. It will appear on a later version. I am sorry that I mentioned it too early, I have updated the answer. I hope this does not bring you too much trouble.
            – Leo Liu-MSFT
            Nov 22 at 1:31








          • 1




            Ok thank you Leo, I will deal with the CLI until this will appears in Visual Studio.
            – maxence51
            Nov 22 at 7:38










          • @maxence51, You are always welcome! :)
            – Leo Liu-MSFT
            Nov 22 at 7:39














          • 1




            Thanks, but where is Re-evaluate and Restore?
            – maxence51
            Nov 21 at 12:27










          • @maxence51, This is a preparing feature. It will appear on a later version. I am sorry that I mentioned it too early, I have updated the answer. I hope this does not bring you too much trouble.
            – Leo Liu-MSFT
            Nov 22 at 1:31








          • 1




            Ok thank you Leo, I will deal with the CLI until this will appears in Visual Studio.
            – maxence51
            Nov 22 at 7:38










          • @maxence51, You are always welcome! :)
            – Leo Liu-MSFT
            Nov 22 at 7:39








          1




          1




          Thanks, but where is Re-evaluate and Restore?
          – maxence51
          Nov 21 at 12:27




          Thanks, but where is Re-evaluate and Restore?
          – maxence51
          Nov 21 at 12:27












          @maxence51, This is a preparing feature. It will appear on a later version. I am sorry that I mentioned it too early, I have updated the answer. I hope this does not bring you too much trouble.
          – Leo Liu-MSFT
          Nov 22 at 1:31






          @maxence51, This is a preparing feature. It will appear on a later version. I am sorry that I mentioned it too early, I have updated the answer. I hope this does not bring you too much trouble.
          – Leo Liu-MSFT
          Nov 22 at 1:31






          1




          1




          Ok thank you Leo, I will deal with the CLI until this will appears in Visual Studio.
          – maxence51
          Nov 22 at 7:38




          Ok thank you Leo, I will deal with the CLI until this will appears in Visual Studio.
          – maxence51
          Nov 22 at 7:38












          @maxence51, You are always welcome! :)
          – Leo Liu-MSFT
          Nov 22 at 7:39




          @maxence51, You are always welcome! :)
          – Leo Liu-MSFT
          Nov 22 at 7:39


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53408075%2fforce-evaluate-floating-version-packages-with-lock-file-via-msbuild-csproj%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

          Berounka

          Sphinx de Gizeh

          Different font size/position of beamer's navigation symbols template's content depending on regular/plain...