Write reference assemblies to intermediate output
The .NET SDK now writes reference assemblies to the IntermediateOutputPath
instead of the OutDir
by default. This change removes these build-time-only artifacts from outputs that you require at run time.
Version introduced
.NET SDK 6.0.200
Old behavior
Since reference assemblies were added, the .NET SDK has written reference assemblies to the ref directory in the OutDir
directory of the compilation. In .NET 5, the ProduceReferenceAssembly property was introduced and defaulted to true
for net5.0
and later applications. With this change, many applications began implicitly generating reference assemblies in the OutDir
directory.
New behavior
Now, reference assemblies are written to the refint
directory of the IntermediateOutputPath
directory by default, like many other intermediate artifacts.
Reason for change
Reference assemblies are generally not run-time assets, and so don't belong in the OutDir
directory by default.
Recommended action
If you have custom build logic and you need to manipulate the reference assemblies, use the TargetRefPath
property to get the correct path.
If an external system requires the reference assembly in OutDir
, set the MSBuild property ProduceReferenceAssemblyInOutDir to true
in your project file.
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho