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 start
I had similar problem with project using:
For that project, the following Azure DevOps Pipeline settings works:
MSBuild arguments:
/t:Publish;Build /p:PublishDir="$(build.artifactstagingdirectory)\" /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:PackageLocation="$(build.artifactstagingdirectory)\"
Visual Studio Test Platform Installer: Latest stable
Select test using: Test assemblies
Testfiles:
*Tests.dll
!**\obj*
Searchfolder:$(System.DefaultWorkingDirectory)
Test results folder: $(Agent.TempDirectory)\TestResults
Test platform version: Installed by Tools Installer
Other console options: /Framework:Framework45 /Diag:log.txt /Logger:console
Build platform: $(BuildPlatform)
Build configuration: $(BuildConfiguration)
=== YAML
steps:
steps:
steps:
steps:
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.
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.
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.
I had a similar problem. The project was building okay but when I published it Azure send me errors.
My project target .NET framework was 4.6.2 version and I was upgrading Nugget packages, unfortunatelly I upgraded my .NET Compilers to last version and it wasnt compatible to my target .NET version.You should be able to see it here:
Description of .NET Compilers
My target framework
I fixed it by downgrading .NET Compilers to a version compatible to my .NET Framework (In my case, to use 4.6.2 framework I need to use .NET Compiller 2.10).
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.