You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am seeing some weirdness with package restore and binlog files (causing me some confusion when analyzing a totally different issue).
I made a testcase (based of an example in RepositoryTests.cs)
Basically this example is trying to:
confirm that PackageReference is actually consumed during a build
make a binlog of the whole process so I can do an analysis of what MSBuild is doing
However, the resulting binlog only shows the "Restore" target in the binlog, whereas I would also have expected a "Build" target in the binlog.
Also searching for PkgPackageA in the binlog does not get any hits, even though the ClassLibraryA.csproj.nuget.g.props contains it on disk.
This is tested with:
VS2022 17.0.6
MSBuildProjectCreator main branch
Note: in order to inspect the binlog file, you need to set a breakpoint to prevent automatic cleanup of the temp folder.
[Fact]publicvoidBuildCanConsumePackageWithGeneratePathProperty(){stringbinLogPath=Path.Combine(TestRootPath,"test.binlog");using(PackageRepository.Create(TestRootPath).Package("PackageB","1.0",outPackagepackageB).Library(TargetFramework).Package("PackageA","1.0.0",outPackagepackageA).Dependency(packageB,TargetFramework).Library(TargetFramework)){using(ProjectCollectionprojectCollection=newProjectCollection()){projectCollection.RegisterLogger(newBinaryLogger{Parameters=$"LogFile={binLogPath}",});ProjectCreator.Templates.SdkCsproj(path:Path.Combine(TestRootPath,"ClassLibraryA","ClassLibraryA.csproj"),targetFramework:TargetFramework,projectCollection:projectCollection).ItemPackageReference(packageA,metadata:newDictionary<string,string>{{"GeneratePathProperty","true"},}).TryBuild(restore:true,outboolresult,outBuildOutputbuildOutput).TryGetPropertyValue("PkgPackageA",outstringpackagePath);result.ShouldBeTrue(buildOutput.GetConsoleLog());packagePath.ShouldNotBeEmpty();}// NOTE: binlog does not look correct and seems to be missing actual content for PkgPackageA }}
The text was updated successfully, but these errors were encountered:
Hi again,
I am seeing some weirdness with package restore and binlog files (causing me some confusion when analyzing a totally different issue).
I made a testcase (based of an example in RepositoryTests.cs)
Basically this example is trying to:
However, the resulting binlog only shows the "Restore" target in the binlog, whereas I would also have expected a "Build" target in the binlog.
Also searching for
PkgPackageA
in the binlog does not get any hits, even though theClassLibraryA.csproj.nuget.g.props
contains it on disk.This is tested with:
Note: in order to inspect the binlog file, you need to set a breakpoint to prevent automatic cleanup of the temp folder.
The text was updated successfully, but these errors were encountered: