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
Describe the bug
When using Docfx.Dotnet and Docfx.App to generate metadata within a c# build process, metadata is not generated. We get a Could not load file or assembly 'NuGet.Frameworks', then all of the usings fail - System, System.Web, etc.
Works fine from a command line manually run, and works fine from a cake build using dotnet tool.
Exceptions
50+ examples of the following, when trying to build for Net7:
warning:[Failure] Msbuild failed when processing the file '<project>.csproj' with message: C:\Program Files\dotnet\sdk\7.0.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets:(90,5): The "ProcessFrameworkReferences" task failed unexpectedly.
System.IO.FileLoadException: Could not load file or assembly 'NuGet.Frameworks, Version=6.7.0.127, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file.(0x80131621)Filename: 'NuGet.Frameworks,Version=6.7.0.127,Culture=neutral,PublicKeyToken=31bf3856ad364e35'
---> System.IO.FileLoadException: Could not load file or assembly 'NuGet.Frameworks,Version=6.7.0.127,Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
at System.Runtime.Loader.AssemblyLoadContext.<LoadFromPath>g____PInvoke|5_0(IntPtr ptrNativeAssemblyBinder,UInt16*ilPath,UInt16*niPath, ObjectHandleOnStack retAssembly)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at Microsoft.Build.Shared.MSBuildLoadContext.Load(AssemblyName assemblyName)
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingLoad(AssemblyName assemblyName)
at System.Runtime.Loader.AssemblyLoadContext.Resolve(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)
at Microsoft.NET.Build.Tasks.ProcessFrameworkReferences.<>c.<ExecuteCore>b__141_0(ITaskItem item)
at System.Linq.Enumerable.SelectArrayIterator`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
at Microsoft.NET.Build.Tasks.ProcessFrameworkReferences.ExecuteCore()
at Microsoft.NET.Build.Tasks.TaskBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
warning:[Warning] Found project reference without a matching metadata reference:<project>.csproj
Exceptions
50+ examples of the following, when trying to build for Net6:
warning:[Failure] Msbuild failed when processing the file '<project>.csproj' with message: C:\Program Files\dotnet\sdk\6.0.414\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets:(90,5): The "ProcessFrameworkReferences" task failed unexpectedly.
System.IO.FileLoadException: Could not load file or assembly 'NuGet.Frameworks, Version=6.3.3.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file.(0x80131621)Filename: 'NuGet.Frameworks,Version=6.3.3.3,Culture=neutral,PublicKeyToken=31bf3856ad364e35'
---> System.IO.FileLoadException: Could not load file or assembly 'NuGet.Frameworks,Version=6.3.3.3,Culture=neutral,PublicKeyToken=31bf3856ad364e35'.
at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at Microsoft.Build.Shared.MSBuildLoadContext.Load(AssemblyName assemblyName)
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingLoad(AssemblyName assemblyName)
at System.Runtime.Loader.AssemblyLoadContext.Resolve(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)
at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
at Microsoft.NET.Build.Tasks.ProcessFrameworkReferences.ExecuteCore()
at Microsoft.NET.Build.Tasks.TaskBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
warning:[Warning] Found project reference without a matching metadata reference:<project>.csproj
Describe the bug
When using Docfx.Dotnet and Docfx.App to generate metadata within a c# build process, metadata is not generated. We get a
Could not load file or assembly 'NuGet.Frameworks'
, then all of the usings fail - System, System.Web, etc.Works fine from a command line manually run, and works fine from a cake build using dotnet tool.
To Reproduce
Steps to reproduce the behavior:
await DotnetApiCatalog.GenerateManagedReferenceYamlFiles(<path-to-docfx.json>)
;Could not load file or assembly 'NuGet.Frameworks'
messageExpected behavior
Metadata to build from c# the same as
dotnet tool run docfx metadata docfx.json
does.Context (please complete the following information):
OS: Windows
DocFx.Dotnet version: 2.71.0
DocFx.App version: 2.71.0
.NET version: .NET 7, .NET 6 doesn't matter which (tried with both)
docfx.json
config50+ examples of the following, when trying to build for Net7:
50+ examples of the following, when trying to build for Net6:
The text was updated successfully, but these errors were encountered: