Project builds but can't publish












19














I have an MVC project that for an uknown reason refuses to publish to a local folder in the PC.



The log says the following:



3>------ Publish started: Project: Admin, Configuration: Release Any CPU ------
3>Connecting to D:Deploys...
3>Project "Admin.csproj" (GatherAllFilesToPublish target(s)):
3> Building with tools version "14.0".
3> Target "ValidateMSBuildToolsVersion" skipped. Previously built unsuccessfully.
3>Done building project "Admin.csproj" -- FAILED.
3>
========== Build: 2 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========


I haven't had a problem debugging on either release or debug config.










share|improve this question






















  • What does a more verbose output say? blogs.msdn.microsoft.com/saraford/2008/10/07/…
    – Caramiriel
    Jan 4 at 20:27










  • @Caramiriel Hi! I already have it on the "diagnostic" option. The "detailed" one also outputs the same.
    – Hrodger
    Jan 4 at 20:28










  • try a clean/rebuild. restart visual studio.
    – Joseph Mawer
    Jan 4 at 20:55










  • @JMawer Hi! Already did that. Delete obj/bin folders, restart VS, restart PC.
    – Hrodger
    Jan 4 at 21:39










  • Perhaps you don't have permission to publish to that folder location? Have you tried installing to a location you are certain you have read/write permissions?
    – Joseph Mawer
    Jan 4 at 21:43
















19














I have an MVC project that for an uknown reason refuses to publish to a local folder in the PC.



The log says the following:



3>------ Publish started: Project: Admin, Configuration: Release Any CPU ------
3>Connecting to D:Deploys...
3>Project "Admin.csproj" (GatherAllFilesToPublish target(s)):
3> Building with tools version "14.0".
3> Target "ValidateMSBuildToolsVersion" skipped. Previously built unsuccessfully.
3>Done building project "Admin.csproj" -- FAILED.
3>
========== Build: 2 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========


I haven't had a problem debugging on either release or debug config.










share|improve this question






















  • What does a more verbose output say? blogs.msdn.microsoft.com/saraford/2008/10/07/…
    – Caramiriel
    Jan 4 at 20:27










  • @Caramiriel Hi! I already have it on the "diagnostic" option. The "detailed" one also outputs the same.
    – Hrodger
    Jan 4 at 20:28










  • try a clean/rebuild. restart visual studio.
    – Joseph Mawer
    Jan 4 at 20:55










  • @JMawer Hi! Already did that. Delete obj/bin folders, restart VS, restart PC.
    – Hrodger
    Jan 4 at 21:39










  • Perhaps you don't have permission to publish to that folder location? Have you tried installing to a location you are certain you have read/write permissions?
    – Joseph Mawer
    Jan 4 at 21:43














19












19








19


10





I have an MVC project that for an uknown reason refuses to publish to a local folder in the PC.



The log says the following:



3>------ Publish started: Project: Admin, Configuration: Release Any CPU ------
3>Connecting to D:Deploys...
3>Project "Admin.csproj" (GatherAllFilesToPublish target(s)):
3> Building with tools version "14.0".
3> Target "ValidateMSBuildToolsVersion" skipped. Previously built unsuccessfully.
3>Done building project "Admin.csproj" -- FAILED.
3>
========== Build: 2 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========


I haven't had a problem debugging on either release or debug config.










share|improve this question













I have an MVC project that for an uknown reason refuses to publish to a local folder in the PC.



The log says the following:



3>------ Publish started: Project: Admin, Configuration: Release Any CPU ------
3>Connecting to D:Deploys...
3>Project "Admin.csproj" (GatherAllFilesToPublish target(s)):
3> Building with tools version "14.0".
3> Target "ValidateMSBuildToolsVersion" skipped. Previously built unsuccessfully.
3>Done building project "Admin.csproj" -- FAILED.
3>
========== Build: 2 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========


I haven't had a problem debugging on either release or debug config.







c# asp.net asp.net-mvc visual-studio visual-studio-2015






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 4 at 20:23









Hrodger

921714




921714












  • What does a more verbose output say? blogs.msdn.microsoft.com/saraford/2008/10/07/…
    – Caramiriel
    Jan 4 at 20:27










  • @Caramiriel Hi! I already have it on the "diagnostic" option. The "detailed" one also outputs the same.
    – Hrodger
    Jan 4 at 20:28










  • try a clean/rebuild. restart visual studio.
    – Joseph Mawer
    Jan 4 at 20:55










  • @JMawer Hi! Already did that. Delete obj/bin folders, restart VS, restart PC.
    – Hrodger
    Jan 4 at 21:39










  • Perhaps you don't have permission to publish to that folder location? Have you tried installing to a location you are certain you have read/write permissions?
    – Joseph Mawer
    Jan 4 at 21:43


















  • What does a more verbose output say? blogs.msdn.microsoft.com/saraford/2008/10/07/…
    – Caramiriel
    Jan 4 at 20:27










  • @Caramiriel Hi! I already have it on the "diagnostic" option. The "detailed" one also outputs the same.
    – Hrodger
    Jan 4 at 20:28










  • try a clean/rebuild. restart visual studio.
    – Joseph Mawer
    Jan 4 at 20:55










  • @JMawer Hi! Already did that. Delete obj/bin folders, restart VS, restart PC.
    – Hrodger
    Jan 4 at 21:39










  • Perhaps you don't have permission to publish to that folder location? Have you tried installing to a location you are certain you have read/write permissions?
    – Joseph Mawer
    Jan 4 at 21:43
















What does a more verbose output say? blogs.msdn.microsoft.com/saraford/2008/10/07/…
– Caramiriel
Jan 4 at 20:27




What does a more verbose output say? blogs.msdn.microsoft.com/saraford/2008/10/07/…
– Caramiriel
Jan 4 at 20:27












@Caramiriel Hi! I already have it on the "diagnostic" option. The "detailed" one also outputs the same.
– Hrodger
Jan 4 at 20:28




@Caramiriel Hi! I already have it on the "diagnostic" option. The "detailed" one also outputs the same.
– Hrodger
Jan 4 at 20:28












try a clean/rebuild. restart visual studio.
– Joseph Mawer
Jan 4 at 20:55




try a clean/rebuild. restart visual studio.
– Joseph Mawer
Jan 4 at 20:55












@JMawer Hi! Already did that. Delete obj/bin folders, restart VS, restart PC.
– Hrodger
Jan 4 at 21:39




@JMawer Hi! Already did that. Delete obj/bin folders, restart VS, restart PC.
– Hrodger
Jan 4 at 21:39












Perhaps you don't have permission to publish to that folder location? Have you tried installing to a location you are certain you have read/write permissions?
– Joseph Mawer
Jan 4 at 21:43




Perhaps you don't have permission to publish to that folder location? Have you tried installing to a location you are certain you have read/write permissions?
– Joseph Mawer
Jan 4 at 21:43












9 Answers
9






active

oldest

votes


















60














So I made it work.



The problem was the version of the "Microsoft.Net.Compilers". I downgraded from v2.6.1 to v2.4.0.



I don't know why so if someone knows it would be cool to know.






share|improve this answer

















  • 1




    Thanks this problem was getting on my nerves, would really want to know why this is happening.
    – ShrtTth
    Jan 10 at 20:21










  • Not just an issue with web publish; I had the problem that my solution rebuild was always failing because of this (two MVC projects, one as a dependency of the other the second one would always fail if the first one still needed to be built).
    – Bjørn van Dommelen
    Jan 17 at 14:11






  • 6




    According to [github.com/dotnet/roslyn/wiki/NuGet-packages] the 2+ versions of the compilers package are for VS2017 and C#7. Also see [github.com/dotnet/roslyn/issues/19128] for what's supported where. Why it actually works with 2.4 and not with 2.6.1 (it shouldn't work with 2.4 either); I can only imagine the build tasks were updated with 2.4 but not with 2.6.1 so 2.6.1 requires MSBUILD 15 again (VS2015 has MSBUILD 14).
    – Bjørn van Dommelen
    Jan 17 at 14:34










  • Going to 2.4.0 fixed for me as well. Per dup suggestion here: stackoverflow.com/questions/48272051/…
    – Chris Emerson
    Feb 23 at 12:14






  • 1




    Had the same, I just uninstalled .Net.Compilers. also solved the problem
    – Jaime Yule
    Mar 19 at 14:36



















2














Sorry for reopening the thread, but for me Cleaning the solution worked on .NET.Compilers v2.7 (Visual Studio 2015).






share|improve this answer





















  • The same worked for me in VS2017, along with deleting all the existing obj and bin folders in sub-projects.
    – Rory McCrossan
    Jun 19 at 13:44



















1














First, select the mode (Debug or Release). Then right click on the solution/project then select Clean. Then choose Rebuild. Then Publish.






share|improve this answer





























    0














    This just happened to me, it turned out to be a simple case of using an int in a ViewComponent call from a razor template, when that argument should have been a Guid. For some reason Intellisense didn't pick it up, I had to turn on detailed verbosity to see the error in the build process.






    share|improve this answer





























      0














      downgrade "Microsoft.Net.Compilers" from v2.9.0 to v2.4.0 works like a charm






      share|improve this answer





























        0














        I was able to resolve my issue altogether by removing the NuGet package "Microsoft.Net.Compilers", rather than downgrade to 2.4.0.



        (For quite some time, the Publish error would disappear if I simply restarted VS, but eventually that stopped working.)






        share|improve this answer





























          0














          I had this problem in Asp.net Core 2 MVC 2.1
          So there was no Microsoft.Net.Compilers in my solution. I tried to rebuild all projects, unload / load again but there was no change.



          1) So, I have upgraded VS 2017 15.7.3 to 15.8.7

          2) Then deleted all bin/release directory contents from each projects in solution.

          3) Then deleted all obj directory contents from each projects in solution.

          4) Then rebuilded all projects one by one.

          Then tried to publish and it succeded.



          Maybe if I tried from step 2 in old Visual Studio it would be succed.






          share|improve this answer





























            0














            Try opening the solution with Visual Studio 2017



            I had been building and publishing from Visual Studio 2015, as that is the version of Visual Studio that the Version Selector picked when I opened the solution file.



            I tried opening my solution file from Visual Studio 2017 instead, and that succeeded in publishing.






            share|improve this answer





























              0














              I had switched to C# 7.3 in Properties > Build > Advanced, but accidentally only did so for the Debug configuration. When publishing (using Release configuration) it was still using C# 7.0, which lacked some of the language features I had used.



              Errors weren't visible in the Error List pane, only in the Output pane.



              Setting the language version to C# 7.3 for "All Configurations" solved it for me.



              This was using current version of Visual Studio 2017, Microsoft.Net.Compilers package not included in project.






              share|improve this answer





















                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%2f48103014%2fproject-builds-but-cant-publish%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                9 Answers
                9






                active

                oldest

                votes








                9 Answers
                9






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                60














                So I made it work.



                The problem was the version of the "Microsoft.Net.Compilers". I downgraded from v2.6.1 to v2.4.0.



                I don't know why so if someone knows it would be cool to know.






                share|improve this answer

















                • 1




                  Thanks this problem was getting on my nerves, would really want to know why this is happening.
                  – ShrtTth
                  Jan 10 at 20:21










                • Not just an issue with web publish; I had the problem that my solution rebuild was always failing because of this (two MVC projects, one as a dependency of the other the second one would always fail if the first one still needed to be built).
                  – Bjørn van Dommelen
                  Jan 17 at 14:11






                • 6




                  According to [github.com/dotnet/roslyn/wiki/NuGet-packages] the 2+ versions of the compilers package are for VS2017 and C#7. Also see [github.com/dotnet/roslyn/issues/19128] for what's supported where. Why it actually works with 2.4 and not with 2.6.1 (it shouldn't work with 2.4 either); I can only imagine the build tasks were updated with 2.4 but not with 2.6.1 so 2.6.1 requires MSBUILD 15 again (VS2015 has MSBUILD 14).
                  – Bjørn van Dommelen
                  Jan 17 at 14:34










                • Going to 2.4.0 fixed for me as well. Per dup suggestion here: stackoverflow.com/questions/48272051/…
                  – Chris Emerson
                  Feb 23 at 12:14






                • 1




                  Had the same, I just uninstalled .Net.Compilers. also solved the problem
                  – Jaime Yule
                  Mar 19 at 14:36
















                60














                So I made it work.



                The problem was the version of the "Microsoft.Net.Compilers". I downgraded from v2.6.1 to v2.4.0.



                I don't know why so if someone knows it would be cool to know.






                share|improve this answer

















                • 1




                  Thanks this problem was getting on my nerves, would really want to know why this is happening.
                  – ShrtTth
                  Jan 10 at 20:21










                • Not just an issue with web publish; I had the problem that my solution rebuild was always failing because of this (two MVC projects, one as a dependency of the other the second one would always fail if the first one still needed to be built).
                  – Bjørn van Dommelen
                  Jan 17 at 14:11






                • 6




                  According to [github.com/dotnet/roslyn/wiki/NuGet-packages] the 2+ versions of the compilers package are for VS2017 and C#7. Also see [github.com/dotnet/roslyn/issues/19128] for what's supported where. Why it actually works with 2.4 and not with 2.6.1 (it shouldn't work with 2.4 either); I can only imagine the build tasks were updated with 2.4 but not with 2.6.1 so 2.6.1 requires MSBUILD 15 again (VS2015 has MSBUILD 14).
                  – Bjørn van Dommelen
                  Jan 17 at 14:34










                • Going to 2.4.0 fixed for me as well. Per dup suggestion here: stackoverflow.com/questions/48272051/…
                  – Chris Emerson
                  Feb 23 at 12:14






                • 1




                  Had the same, I just uninstalled .Net.Compilers. also solved the problem
                  – Jaime Yule
                  Mar 19 at 14:36














                60












                60








                60






                So I made it work.



                The problem was the version of the "Microsoft.Net.Compilers". I downgraded from v2.6.1 to v2.4.0.



                I don't know why so if someone knows it would be cool to know.






                share|improve this answer












                So I made it work.



                The problem was the version of the "Microsoft.Net.Compilers". I downgraded from v2.6.1 to v2.4.0.



                I don't know why so if someone knows it would be cool to know.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 4 at 21:53









                Hrodger

                921714




                921714








                • 1




                  Thanks this problem was getting on my nerves, would really want to know why this is happening.
                  – ShrtTth
                  Jan 10 at 20:21










                • Not just an issue with web publish; I had the problem that my solution rebuild was always failing because of this (two MVC projects, one as a dependency of the other the second one would always fail if the first one still needed to be built).
                  – Bjørn van Dommelen
                  Jan 17 at 14:11






                • 6




                  According to [github.com/dotnet/roslyn/wiki/NuGet-packages] the 2+ versions of the compilers package are for VS2017 and C#7. Also see [github.com/dotnet/roslyn/issues/19128] for what's supported where. Why it actually works with 2.4 and not with 2.6.1 (it shouldn't work with 2.4 either); I can only imagine the build tasks were updated with 2.4 but not with 2.6.1 so 2.6.1 requires MSBUILD 15 again (VS2015 has MSBUILD 14).
                  – Bjørn van Dommelen
                  Jan 17 at 14:34










                • Going to 2.4.0 fixed for me as well. Per dup suggestion here: stackoverflow.com/questions/48272051/…
                  – Chris Emerson
                  Feb 23 at 12:14






                • 1




                  Had the same, I just uninstalled .Net.Compilers. also solved the problem
                  – Jaime Yule
                  Mar 19 at 14:36














                • 1




                  Thanks this problem was getting on my nerves, would really want to know why this is happening.
                  – ShrtTth
                  Jan 10 at 20:21










                • Not just an issue with web publish; I had the problem that my solution rebuild was always failing because of this (two MVC projects, one as a dependency of the other the second one would always fail if the first one still needed to be built).
                  – Bjørn van Dommelen
                  Jan 17 at 14:11






                • 6




                  According to [github.com/dotnet/roslyn/wiki/NuGet-packages] the 2+ versions of the compilers package are for VS2017 and C#7. Also see [github.com/dotnet/roslyn/issues/19128] for what's supported where. Why it actually works with 2.4 and not with 2.6.1 (it shouldn't work with 2.4 either); I can only imagine the build tasks were updated with 2.4 but not with 2.6.1 so 2.6.1 requires MSBUILD 15 again (VS2015 has MSBUILD 14).
                  – Bjørn van Dommelen
                  Jan 17 at 14:34










                • Going to 2.4.0 fixed for me as well. Per dup suggestion here: stackoverflow.com/questions/48272051/…
                  – Chris Emerson
                  Feb 23 at 12:14






                • 1




                  Had the same, I just uninstalled .Net.Compilers. also solved the problem
                  – Jaime Yule
                  Mar 19 at 14:36








                1




                1




                Thanks this problem was getting on my nerves, would really want to know why this is happening.
                – ShrtTth
                Jan 10 at 20:21




                Thanks this problem was getting on my nerves, would really want to know why this is happening.
                – ShrtTth
                Jan 10 at 20:21












                Not just an issue with web publish; I had the problem that my solution rebuild was always failing because of this (two MVC projects, one as a dependency of the other the second one would always fail if the first one still needed to be built).
                – Bjørn van Dommelen
                Jan 17 at 14:11




                Not just an issue with web publish; I had the problem that my solution rebuild was always failing because of this (two MVC projects, one as a dependency of the other the second one would always fail if the first one still needed to be built).
                – Bjørn van Dommelen
                Jan 17 at 14:11




                6




                6




                According to [github.com/dotnet/roslyn/wiki/NuGet-packages] the 2+ versions of the compilers package are for VS2017 and C#7. Also see [github.com/dotnet/roslyn/issues/19128] for what's supported where. Why it actually works with 2.4 and not with 2.6.1 (it shouldn't work with 2.4 either); I can only imagine the build tasks were updated with 2.4 but not with 2.6.1 so 2.6.1 requires MSBUILD 15 again (VS2015 has MSBUILD 14).
                – Bjørn van Dommelen
                Jan 17 at 14:34




                According to [github.com/dotnet/roslyn/wiki/NuGet-packages] the 2+ versions of the compilers package are for VS2017 and C#7. Also see [github.com/dotnet/roslyn/issues/19128] for what's supported where. Why it actually works with 2.4 and not with 2.6.1 (it shouldn't work with 2.4 either); I can only imagine the build tasks were updated with 2.4 but not with 2.6.1 so 2.6.1 requires MSBUILD 15 again (VS2015 has MSBUILD 14).
                – Bjørn van Dommelen
                Jan 17 at 14:34












                Going to 2.4.0 fixed for me as well. Per dup suggestion here: stackoverflow.com/questions/48272051/…
                – Chris Emerson
                Feb 23 at 12:14




                Going to 2.4.0 fixed for me as well. Per dup suggestion here: stackoverflow.com/questions/48272051/…
                – Chris Emerson
                Feb 23 at 12:14




                1




                1




                Had the same, I just uninstalled .Net.Compilers. also solved the problem
                – Jaime Yule
                Mar 19 at 14:36




                Had the same, I just uninstalled .Net.Compilers. also solved the problem
                – Jaime Yule
                Mar 19 at 14:36













                2














                Sorry for reopening the thread, but for me Cleaning the solution worked on .NET.Compilers v2.7 (Visual Studio 2015).






                share|improve this answer





















                • The same worked for me in VS2017, along with deleting all the existing obj and bin folders in sub-projects.
                  – Rory McCrossan
                  Jun 19 at 13:44
















                2














                Sorry for reopening the thread, but for me Cleaning the solution worked on .NET.Compilers v2.7 (Visual Studio 2015).






                share|improve this answer





















                • The same worked for me in VS2017, along with deleting all the existing obj and bin folders in sub-projects.
                  – Rory McCrossan
                  Jun 19 at 13:44














                2












                2








                2






                Sorry for reopening the thread, but for me Cleaning the solution worked on .NET.Compilers v2.7 (Visual Studio 2015).






                share|improve this answer












                Sorry for reopening the thread, but for me Cleaning the solution worked on .NET.Compilers v2.7 (Visual Studio 2015).







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 25 at 4:41









                eLGi

                63110




                63110












                • The same worked for me in VS2017, along with deleting all the existing obj and bin folders in sub-projects.
                  – Rory McCrossan
                  Jun 19 at 13:44


















                • The same worked for me in VS2017, along with deleting all the existing obj and bin folders in sub-projects.
                  – Rory McCrossan
                  Jun 19 at 13:44
















                The same worked for me in VS2017, along with deleting all the existing obj and bin folders in sub-projects.
                – Rory McCrossan
                Jun 19 at 13:44




                The same worked for me in VS2017, along with deleting all the existing obj and bin folders in sub-projects.
                – Rory McCrossan
                Jun 19 at 13:44











                1














                First, select the mode (Debug or Release). Then right click on the solution/project then select Clean. Then choose Rebuild. Then Publish.






                share|improve this answer


























                  1














                  First, select the mode (Debug or Release). Then right click on the solution/project then select Clean. Then choose Rebuild. Then Publish.






                  share|improve this answer
























                    1












                    1








                    1






                    First, select the mode (Debug or Release). Then right click on the solution/project then select Clean. Then choose Rebuild. Then Publish.






                    share|improve this answer












                    First, select the mode (Debug or Release). Then right click on the solution/project then select Clean. Then choose Rebuild. Then Publish.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Oct 25 at 11:50









                    Jin Ginusuke

                    27119




                    27119























                        0














                        This just happened to me, it turned out to be a simple case of using an int in a ViewComponent call from a razor template, when that argument should have been a Guid. For some reason Intellisense didn't pick it up, I had to turn on detailed verbosity to see the error in the build process.






                        share|improve this answer


























                          0














                          This just happened to me, it turned out to be a simple case of using an int in a ViewComponent call from a razor template, when that argument should have been a Guid. For some reason Intellisense didn't pick it up, I had to turn on detailed verbosity to see the error in the build process.






                          share|improve this answer
























                            0












                            0








                            0






                            This just happened to me, it turned out to be a simple case of using an int in a ViewComponent call from a razor template, when that argument should have been a Guid. For some reason Intellisense didn't pick it up, I had to turn on detailed verbosity to see the error in the build process.






                            share|improve this answer












                            This just happened to me, it turned out to be a simple case of using an int in a ViewComponent call from a razor template, when that argument should have been a Guid. For some reason Intellisense didn't pick it up, I had to turn on detailed verbosity to see the error in the build process.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Aug 22 at 13:50









                            jmdon

                            569312




                            569312























                                0














                                downgrade "Microsoft.Net.Compilers" from v2.9.0 to v2.4.0 works like a charm






                                share|improve this answer


























                                  0














                                  downgrade "Microsoft.Net.Compilers" from v2.9.0 to v2.4.0 works like a charm






                                  share|improve this answer
























                                    0












                                    0








                                    0






                                    downgrade "Microsoft.Net.Compilers" from v2.9.0 to v2.4.0 works like a charm






                                    share|improve this answer












                                    downgrade "Microsoft.Net.Compilers" from v2.9.0 to v2.4.0 works like a charm







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Aug 31 at 3:11









                                    Diego Ruiz de Chavez

                                    115




                                    115























                                        0














                                        I was able to resolve my issue altogether by removing the NuGet package "Microsoft.Net.Compilers", rather than downgrade to 2.4.0.



                                        (For quite some time, the Publish error would disappear if I simply restarted VS, but eventually that stopped working.)






                                        share|improve this answer


























                                          0














                                          I was able to resolve my issue altogether by removing the NuGet package "Microsoft.Net.Compilers", rather than downgrade to 2.4.0.



                                          (For quite some time, the Publish error would disappear if I simply restarted VS, but eventually that stopped working.)






                                          share|improve this answer
























                                            0












                                            0








                                            0






                                            I was able to resolve my issue altogether by removing the NuGet package "Microsoft.Net.Compilers", rather than downgrade to 2.4.0.



                                            (For quite some time, the Publish error would disappear if I simply restarted VS, but eventually that stopped working.)






                                            share|improve this answer












                                            I was able to resolve my issue altogether by removing the NuGet package "Microsoft.Net.Compilers", rather than downgrade to 2.4.0.



                                            (For quite some time, the Publish error would disappear if I simply restarted VS, but eventually that stopped working.)







                                            share|improve this answer












                                            share|improve this answer



                                            share|improve this answer










                                            answered Oct 9 at 19:45









                                            zanussi

                                            70521826




                                            70521826























                                                0














                                                I had this problem in Asp.net Core 2 MVC 2.1
                                                So there was no Microsoft.Net.Compilers in my solution. I tried to rebuild all projects, unload / load again but there was no change.



                                                1) So, I have upgraded VS 2017 15.7.3 to 15.8.7

                                                2) Then deleted all bin/release directory contents from each projects in solution.

                                                3) Then deleted all obj directory contents from each projects in solution.

                                                4) Then rebuilded all projects one by one.

                                                Then tried to publish and it succeded.



                                                Maybe if I tried from step 2 in old Visual Studio it would be succed.






                                                share|improve this answer


























                                                  0














                                                  I had this problem in Asp.net Core 2 MVC 2.1
                                                  So there was no Microsoft.Net.Compilers in my solution. I tried to rebuild all projects, unload / load again but there was no change.



                                                  1) So, I have upgraded VS 2017 15.7.3 to 15.8.7

                                                  2) Then deleted all bin/release directory contents from each projects in solution.

                                                  3) Then deleted all obj directory contents from each projects in solution.

                                                  4) Then rebuilded all projects one by one.

                                                  Then tried to publish and it succeded.



                                                  Maybe if I tried from step 2 in old Visual Studio it would be succed.






                                                  share|improve this answer
























                                                    0












                                                    0








                                                    0






                                                    I had this problem in Asp.net Core 2 MVC 2.1
                                                    So there was no Microsoft.Net.Compilers in my solution. I tried to rebuild all projects, unload / load again but there was no change.



                                                    1) So, I have upgraded VS 2017 15.7.3 to 15.8.7

                                                    2) Then deleted all bin/release directory contents from each projects in solution.

                                                    3) Then deleted all obj directory contents from each projects in solution.

                                                    4) Then rebuilded all projects one by one.

                                                    Then tried to publish and it succeded.



                                                    Maybe if I tried from step 2 in old Visual Studio it would be succed.






                                                    share|improve this answer












                                                    I had this problem in Asp.net Core 2 MVC 2.1
                                                    So there was no Microsoft.Net.Compilers in my solution. I tried to rebuild all projects, unload / load again but there was no change.



                                                    1) So, I have upgraded VS 2017 15.7.3 to 15.8.7

                                                    2) Then deleted all bin/release directory contents from each projects in solution.

                                                    3) Then deleted all obj directory contents from each projects in solution.

                                                    4) Then rebuilded all projects one by one.

                                                    Then tried to publish and it succeded.



                                                    Maybe if I tried from step 2 in old Visual Studio it would be succed.







                                                    share|improve this answer












                                                    share|improve this answer



                                                    share|improve this answer










                                                    answered Oct 21 at 9:35









                                                    Omer Faruk KAYA

                                                    11




                                                    11























                                                        0














                                                        Try opening the solution with Visual Studio 2017



                                                        I had been building and publishing from Visual Studio 2015, as that is the version of Visual Studio that the Version Selector picked when I opened the solution file.



                                                        I tried opening my solution file from Visual Studio 2017 instead, and that succeeded in publishing.






                                                        share|improve this answer


























                                                          0














                                                          Try opening the solution with Visual Studio 2017



                                                          I had been building and publishing from Visual Studio 2015, as that is the version of Visual Studio that the Version Selector picked when I opened the solution file.



                                                          I tried opening my solution file from Visual Studio 2017 instead, and that succeeded in publishing.






                                                          share|improve this answer
























                                                            0












                                                            0








                                                            0






                                                            Try opening the solution with Visual Studio 2017



                                                            I had been building and publishing from Visual Studio 2015, as that is the version of Visual Studio that the Version Selector picked when I opened the solution file.



                                                            I tried opening my solution file from Visual Studio 2017 instead, and that succeeded in publishing.






                                                            share|improve this answer












                                                            Try opening the solution with Visual Studio 2017



                                                            I had been building and publishing from Visual Studio 2015, as that is the version of Visual Studio that the Version Selector picked when I opened the solution file.



                                                            I tried opening my solution file from Visual Studio 2017 instead, and that succeeded in publishing.







                                                            share|improve this answer












                                                            share|improve this answer



                                                            share|improve this answer










                                                            answered Nov 12 at 1:29









                                                            Nacht

                                                            2,0141931




                                                            2,0141931























                                                                0














                                                                I had switched to C# 7.3 in Properties > Build > Advanced, but accidentally only did so for the Debug configuration. When publishing (using Release configuration) it was still using C# 7.0, which lacked some of the language features I had used.



                                                                Errors weren't visible in the Error List pane, only in the Output pane.



                                                                Setting the language version to C# 7.3 for "All Configurations" solved it for me.



                                                                This was using current version of Visual Studio 2017, Microsoft.Net.Compilers package not included in project.






                                                                share|improve this answer


























                                                                  0














                                                                  I had switched to C# 7.3 in Properties > Build > Advanced, but accidentally only did so for the Debug configuration. When publishing (using Release configuration) it was still using C# 7.0, which lacked some of the language features I had used.



                                                                  Errors weren't visible in the Error List pane, only in the Output pane.



                                                                  Setting the language version to C# 7.3 for "All Configurations" solved it for me.



                                                                  This was using current version of Visual Studio 2017, Microsoft.Net.Compilers package not included in project.






                                                                  share|improve this answer
























                                                                    0












                                                                    0








                                                                    0






                                                                    I had switched to C# 7.3 in Properties > Build > Advanced, but accidentally only did so for the Debug configuration. When publishing (using Release configuration) it was still using C# 7.0, which lacked some of the language features I had used.



                                                                    Errors weren't visible in the Error List pane, only in the Output pane.



                                                                    Setting the language version to C# 7.3 for "All Configurations" solved it for me.



                                                                    This was using current version of Visual Studio 2017, Microsoft.Net.Compilers package not included in project.






                                                                    share|improve this answer












                                                                    I had switched to C# 7.3 in Properties > Build > Advanced, but accidentally only did so for the Debug configuration. When publishing (using Release configuration) it was still using C# 7.0, which lacked some of the language features I had used.



                                                                    Errors weren't visible in the Error List pane, only in the Output pane.



                                                                    Setting the language version to C# 7.3 for "All Configurations" solved it for me.



                                                                    This was using current version of Visual Studio 2017, Microsoft.Net.Compilers package not included in project.







                                                                    share|improve this answer












                                                                    share|improve this answer



                                                                    share|improve this answer










                                                                    answered Dec 20 at 9:08









                                                                    Ted Nyberg

                                                                    3,85642555




                                                                    3,85642555






























                                                                        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%2f48103014%2fproject-builds-but-cant-publish%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







                                                                        這個網誌中的熱門文章

                                                                        Academy of Television Arts & Sciences

                                                                        L'Équipe

                                                                        1995 France bombings