Closed patearl closed 2 years ago
Can you please attach or paste the content of log
from the code above after calling projectAnalyzer.Build(environment)
- that should contain the MSBuild output as well as information about the MSBuild exit code or any other problems encountered during execution.
Let me know if you see an error along the lines of MSBUILD : error MSB1021: Cannot create an instance of the logger. Could not load file or assembly 'MsBuildPipeLogger.Logger, Version=1.1.2.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
That suggests the MsBuildPipeLogger package wasn't correctly installed or available.
This is what we see from the log
=================== BUILD OUTPUT =====================
Started process 2292: "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\msbuild.exe" /noconsolelogger /target:Restore /property:ProvideCommandLineArgs="true";GenerateResourceMSBuildArchitecture="CurrentArchitecture";DesignTimeBuild="true";BuildProjectReferences="false";SkipCompilerExecution="true";DisableRarCache="true";AutoGenerateBindingRedirects="false";CopyBuildOutputToOutputDirectory="false";CopyOutputSymbolsToOutputDirectory="false";SkipCopyBuildProduct="true";AddModules="false";UseCommonOutputDirectory="true";GeneratePackageOnBuild="false";RunModellerGenerator="false";NonExistentFile="__NonExistentSubDir__\__NonExistentFile__";ResolveNuGetPackages="true";SolutionDir="T:\w\1ad69c20e141098a\Source\Pleasant.VirtualFileSystem" /l:BuildalyzerLogger,"C:\USERS\MRBUILD\.NUGET\PACKAGES\PLEASANTMODELLER.GENERATOR\5.1.25\BUILD\Buildalyzer.Logger.dll";2844;False "T:\w\1ad69c20e141098a\Source\Pleasant.VirtualFileSystem\Pleasant.VirtualFileSystem.csproj"
Microsoft (R) Build Engine version 15.7.179.6572 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Process 2292 exited with code 0
Started process 3724: "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\msbuild.exe" /noconsolelogger /target:Clean;Build /property:ProvideCommandLineArgs="true";GenerateResourceMSBuildArchitecture="CurrentArchitecture";DesignTimeBuild="true";BuildProjectReferences="false";SkipCompilerExecution="true";DisableRarCache="true";AutoGenerateBindingRedirects="false";CopyBuildOutputToOutputDirectory="false";CopyOutputSymbolsToOutputDirectory="false";SkipCopyBuildProduct="true";AddModules="false";UseCommonOutputDirectory="true";GeneratePackageOnBuild="false";RunModellerGenerator="false";NonExistentFile="__NonExistentSubDir__\__NonExistentFile__";ResolveNuGetPackages="true";SolutionDir="T:\w\1ad69c20e141098a\Source\Pleasant.VirtualFileSystem" /l:BuildalyzerLogger,"C:\USERS\MRBUILD\.NUGET\PACKAGES\PLEASANTMODELLER.GENERATOR\5.1.25\BUILD\Buildalyzer.Logger.dll";2904;False "T:\w\1ad69c20e141098a\Source\Pleasant.VirtualFileSystem\Pleasant.VirtualFileSystem.csproj"
Microsoft (R) Build Engine version 15.7.179.6572 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Process 3724 exited with code 0
======================================================
I work with @patearl
A little more detail of what we are doing and what is going wrong:
We have an MSBuild task that is generating some code for us.
Part of that code examines the project file and loads embedded resources from referenced DLLs.
We are attempting to run Buildalyzer inside the custom task to give us the list of referenced DLLs that used to be present in the csproj
structure directly.
This works for us on our development machines from within visual studio. It fails when we try to run it from the MSBuild script we use for CI.
Hi folks, sorry for the really long silence!
Version 2.3.0 was just released and it includes a much better mechanism for finding the most recent MSBuild. I'm wondering if the resolution of MSBuild was different between development and CI. If you get a chance and this is still an issue, could you try version 2.3.0 and report back. If that doesn't help the next step will be to turn on some more aggressive logging and output a binlog.
Since this is pretty old and there have been ongoing improvements, I'm going to assume this issue is either resolved or no longer relevant. Please comment or open a new issue if that's incorrect and you're still having trouble.
This is the code that runs:
The problem is that analyzerResults is empty (not null).
After removing the two logging things, this is the command that it runs:
The build output from that command is attached in output.txt.
I imagine there is some sort of failure reading the output somehow since it looks like the build is doing what it is supposed to.
output.txt