nuget.exe fail: Missing required property 'OutputPath' for project type 'PackageReference'












1















(Using nuget.exe version 4.9.2 and Visual Studio 2017 Community Edition)



I'm stumped on a nuget.exe restore issue. I'm using Jenkins to build pushed sources. I had a solution with a single project in it, Roadmap, and that built fine, including using



nuget.exe restore "test.sln"


to restore the nuget packages. My Jenkins builds always start with an empty directory.



Now I have a second project. It uses several of the same nuget packages. But when Jenkins runs the same nuget.exe command on the .sln file, I get this error:



C:Jenkinsworkspacetest>nuget restore "test.sln"
MSBuild auto-detection: using msbuild version '12.0' from 'C:Program Files (x86
)MSBuild12.0binamd64'.
All packages listed in packages.config are already installed.
Invalid restore input. Missing required property 'OutputPath' for project type '
PackageReference'. Input files: C:JenkinsworkspacetestRoadtripRoadtrip.csproj.


I do see the OutputPath set in both of the .csproj files in my solution. But the error message isn't completely misleading. Roadmap.csproj, the original, has lines like these for the nuget packages:



  <ItemGroup>
<Reference Include="CommonServiceLocator, Version=2.0.4.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..packagesCommonServiceLocator.2.0.4libnet45CommonServiceLocator.dll</HintPath>
</Reference>
...


In Roadtrip.csproj, the new one, the equivalent section holds



  <ItemGroup>
<PackageReference Include="CommonServiceLocator">
<Version>2.0.4</Version>
</PackageReference>
...


This is the case whether I use the solution nuget manager to add packages to one or both projects, or use each project nuget manager to add their packages.



From what I've seen online, Roadtrip that looks fine. I'm not sure why it would differ from Roadmap. From within Visual Studio, the references are found and both apps run, with the correct DLLs sitting in the debug and release directories. Additionally, when I run the nuget.exe line on my laptop, the packages are retrieved.



It's only when I run it on the remote Jenkins server that it fails. I've tried looking for the differences in the configurations, but they're not jumping out, what I can find that's relevant matches on both. I'm hoping there's someone knowledgeable here who knows the specifics of why I'd see that error message.



I appreciate any assistance.



Update: I was going to add this in the morning, and Scott mentioned doing so as well... I'm picking on Jenkins, but it's really the machine Jenkins is running on. I can open a cmd window on my laptop (not the MSVC cmd window), wipe out the solution packages directory and all obj/bin subdirectories, and nuget.exe restore test.sln completes successfully. Doing the same on the machine with Jenkins fails as shown above... and used to work before I added the second project. The versions of nuget and Visual Studio are the same on both, the environment variables in the cmd windows are the same on both.










share|improve this question

























  • Can you clarify "It's only when I run it on the remote Jenkins server that it fails."? Please do not respond in comments; edit your question to make it clearer and more complete.

    – Scott
    Dec 21 '18 at 1:37
















1















(Using nuget.exe version 4.9.2 and Visual Studio 2017 Community Edition)



I'm stumped on a nuget.exe restore issue. I'm using Jenkins to build pushed sources. I had a solution with a single project in it, Roadmap, and that built fine, including using



nuget.exe restore "test.sln"


to restore the nuget packages. My Jenkins builds always start with an empty directory.



Now I have a second project. It uses several of the same nuget packages. But when Jenkins runs the same nuget.exe command on the .sln file, I get this error:



C:Jenkinsworkspacetest>nuget restore "test.sln"
MSBuild auto-detection: using msbuild version '12.0' from 'C:Program Files (x86
)MSBuild12.0binamd64'.
All packages listed in packages.config are already installed.
Invalid restore input. Missing required property 'OutputPath' for project type '
PackageReference'. Input files: C:JenkinsworkspacetestRoadtripRoadtrip.csproj.


I do see the OutputPath set in both of the .csproj files in my solution. But the error message isn't completely misleading. Roadmap.csproj, the original, has lines like these for the nuget packages:



  <ItemGroup>
<Reference Include="CommonServiceLocator, Version=2.0.4.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..packagesCommonServiceLocator.2.0.4libnet45CommonServiceLocator.dll</HintPath>
</Reference>
...


In Roadtrip.csproj, the new one, the equivalent section holds



  <ItemGroup>
<PackageReference Include="CommonServiceLocator">
<Version>2.0.4</Version>
</PackageReference>
...


This is the case whether I use the solution nuget manager to add packages to one or both projects, or use each project nuget manager to add their packages.



From what I've seen online, Roadtrip that looks fine. I'm not sure why it would differ from Roadmap. From within Visual Studio, the references are found and both apps run, with the correct DLLs sitting in the debug and release directories. Additionally, when I run the nuget.exe line on my laptop, the packages are retrieved.



It's only when I run it on the remote Jenkins server that it fails. I've tried looking for the differences in the configurations, but they're not jumping out, what I can find that's relevant matches on both. I'm hoping there's someone knowledgeable here who knows the specifics of why I'd see that error message.



I appreciate any assistance.



Update: I was going to add this in the morning, and Scott mentioned doing so as well... I'm picking on Jenkins, but it's really the machine Jenkins is running on. I can open a cmd window on my laptop (not the MSVC cmd window), wipe out the solution packages directory and all obj/bin subdirectories, and nuget.exe restore test.sln completes successfully. Doing the same on the machine with Jenkins fails as shown above... and used to work before I added the second project. The versions of nuget and Visual Studio are the same on both, the environment variables in the cmd windows are the same on both.










share|improve this question

























  • Can you clarify "It's only when I run it on the remote Jenkins server that it fails."? Please do not respond in comments; edit your question to make it clearer and more complete.

    – Scott
    Dec 21 '18 at 1:37














1












1








1








(Using nuget.exe version 4.9.2 and Visual Studio 2017 Community Edition)



I'm stumped on a nuget.exe restore issue. I'm using Jenkins to build pushed sources. I had a solution with a single project in it, Roadmap, and that built fine, including using



nuget.exe restore "test.sln"


to restore the nuget packages. My Jenkins builds always start with an empty directory.



Now I have a second project. It uses several of the same nuget packages. But when Jenkins runs the same nuget.exe command on the .sln file, I get this error:



C:Jenkinsworkspacetest>nuget restore "test.sln"
MSBuild auto-detection: using msbuild version '12.0' from 'C:Program Files (x86
)MSBuild12.0binamd64'.
All packages listed in packages.config are already installed.
Invalid restore input. Missing required property 'OutputPath' for project type '
PackageReference'. Input files: C:JenkinsworkspacetestRoadtripRoadtrip.csproj.


I do see the OutputPath set in both of the .csproj files in my solution. But the error message isn't completely misleading. Roadmap.csproj, the original, has lines like these for the nuget packages:



  <ItemGroup>
<Reference Include="CommonServiceLocator, Version=2.0.4.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..packagesCommonServiceLocator.2.0.4libnet45CommonServiceLocator.dll</HintPath>
</Reference>
...


In Roadtrip.csproj, the new one, the equivalent section holds



  <ItemGroup>
<PackageReference Include="CommonServiceLocator">
<Version>2.0.4</Version>
</PackageReference>
...


This is the case whether I use the solution nuget manager to add packages to one or both projects, or use each project nuget manager to add their packages.



From what I've seen online, Roadtrip that looks fine. I'm not sure why it would differ from Roadmap. From within Visual Studio, the references are found and both apps run, with the correct DLLs sitting in the debug and release directories. Additionally, when I run the nuget.exe line on my laptop, the packages are retrieved.



It's only when I run it on the remote Jenkins server that it fails. I've tried looking for the differences in the configurations, but they're not jumping out, what I can find that's relevant matches on both. I'm hoping there's someone knowledgeable here who knows the specifics of why I'd see that error message.



I appreciate any assistance.



Update: I was going to add this in the morning, and Scott mentioned doing so as well... I'm picking on Jenkins, but it's really the machine Jenkins is running on. I can open a cmd window on my laptop (not the MSVC cmd window), wipe out the solution packages directory and all obj/bin subdirectories, and nuget.exe restore test.sln completes successfully. Doing the same on the machine with Jenkins fails as shown above... and used to work before I added the second project. The versions of nuget and Visual Studio are the same on both, the environment variables in the cmd windows are the same on both.










share|improve this question
















(Using nuget.exe version 4.9.2 and Visual Studio 2017 Community Edition)



I'm stumped on a nuget.exe restore issue. I'm using Jenkins to build pushed sources. I had a solution with a single project in it, Roadmap, and that built fine, including using



nuget.exe restore "test.sln"


to restore the nuget packages. My Jenkins builds always start with an empty directory.



Now I have a second project. It uses several of the same nuget packages. But when Jenkins runs the same nuget.exe command on the .sln file, I get this error:



C:Jenkinsworkspacetest>nuget restore "test.sln"
MSBuild auto-detection: using msbuild version '12.0' from 'C:Program Files (x86
)MSBuild12.0binamd64'.
All packages listed in packages.config are already installed.
Invalid restore input. Missing required property 'OutputPath' for project type '
PackageReference'. Input files: C:JenkinsworkspacetestRoadtripRoadtrip.csproj.


I do see the OutputPath set in both of the .csproj files in my solution. But the error message isn't completely misleading. Roadmap.csproj, the original, has lines like these for the nuget packages:



  <ItemGroup>
<Reference Include="CommonServiceLocator, Version=2.0.4.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..packagesCommonServiceLocator.2.0.4libnet45CommonServiceLocator.dll</HintPath>
</Reference>
...


In Roadtrip.csproj, the new one, the equivalent section holds



  <ItemGroup>
<PackageReference Include="CommonServiceLocator">
<Version>2.0.4</Version>
</PackageReference>
...


This is the case whether I use the solution nuget manager to add packages to one or both projects, or use each project nuget manager to add their packages.



From what I've seen online, Roadtrip that looks fine. I'm not sure why it would differ from Roadmap. From within Visual Studio, the references are found and both apps run, with the correct DLLs sitting in the debug and release directories. Additionally, when I run the nuget.exe line on my laptop, the packages are retrieved.



It's only when I run it on the remote Jenkins server that it fails. I've tried looking for the differences in the configurations, but they're not jumping out, what I can find that's relevant matches on both. I'm hoping there's someone knowledgeable here who knows the specifics of why I'd see that error message.



I appreciate any assistance.



Update: I was going to add this in the morning, and Scott mentioned doing so as well... I'm picking on Jenkins, but it's really the machine Jenkins is running on. I can open a cmd window on my laptop (not the MSVC cmd window), wipe out the solution packages directory and all obj/bin subdirectories, and nuget.exe restore test.sln completes successfully. Doing the same on the machine with Jenkins fails as shown above... and used to work before I added the second project. The versions of nuget and Visual Studio are the same on both, the environment variables in the cmd windows are the same on both.







windows command-line jenkins visual-studio-2017






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 21 '18 at 14:45







trueskew

















asked Dec 21 '18 at 1:14









trueskewtrueskew

62




62













  • Can you clarify "It's only when I run it on the remote Jenkins server that it fails."? Please do not respond in comments; edit your question to make it clearer and more complete.

    – Scott
    Dec 21 '18 at 1:37



















  • Can you clarify "It's only when I run it on the remote Jenkins server that it fails."? Please do not respond in comments; edit your question to make it clearer and more complete.

    – Scott
    Dec 21 '18 at 1:37

















Can you clarify "It's only when I run it on the remote Jenkins server that it fails."? Please do not respond in comments; edit your question to make it clearer and more complete.

– Scott
Dec 21 '18 at 1:37





Can you clarify "It's only when I run it on the remote Jenkins server that it fails."? Please do not respond in comments; edit your question to make it clearer and more complete.

– Scott
Dec 21 '18 at 1:37










1 Answer
1






active

oldest

votes


















0














My working answer is that the Visual Studio / nuget.exe versions I'm using do not support PackageReference in .csproj files. I've read that it should, but couldn't get past this issue. Once I modified my Roadmap project to use packages.config and modified my .csproj file to match the Roadmap file, the nuget restore command worked as expected.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    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%2fsuperuser.com%2fquestions%2f1386488%2fnuget-exe-fail-missing-required-property-outputpath-for-project-type-package%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









    0














    My working answer is that the Visual Studio / nuget.exe versions I'm using do not support PackageReference in .csproj files. I've read that it should, but couldn't get past this issue. Once I modified my Roadmap project to use packages.config and modified my .csproj file to match the Roadmap file, the nuget restore command worked as expected.






    share|improve this answer




























      0














      My working answer is that the Visual Studio / nuget.exe versions I'm using do not support PackageReference in .csproj files. I've read that it should, but couldn't get past this issue. Once I modified my Roadmap project to use packages.config and modified my .csproj file to match the Roadmap file, the nuget restore command worked as expected.






      share|improve this answer


























        0












        0








        0







        My working answer is that the Visual Studio / nuget.exe versions I'm using do not support PackageReference in .csproj files. I've read that it should, but couldn't get past this issue. Once I modified my Roadmap project to use packages.config and modified my .csproj file to match the Roadmap file, the nuget restore command worked as expected.






        share|improve this answer













        My working answer is that the Visual Studio / nuget.exe versions I'm using do not support PackageReference in .csproj files. I've read that it should, but couldn't get past this issue. Once I modified my Roadmap project to use packages.config and modified my .csproj file to match the Roadmap file, the nuget restore command worked as expected.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 31 '18 at 19:29









        trueskewtrueskew

        62




        62






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • 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%2fsuperuser.com%2fquestions%2f1386488%2fnuget-exe-fail-missing-required-property-outputpath-for-project-type-package%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

            Plaza Victoria

            Brian Clough

            Cáceres