MSBuild not finding the DLL

Fil*_*oth 1 msbuild

I emit a console app with Mono.Cecil and I want to integrate MSBuild into the build process. But then when I run dotnet build on my custom project file, MSBuild throws an error saying Expected file "obj\Debug\net5.0\refint\test.dll" does not exist. It's trying to find the generated assembly inside the refint folder. When the assembly gets generated inside obj\Debug\net5.0\test.dll as it should. Is there a way I can change the path where MSBuild looks for the output assembly? Everything on the side of the IL generator works, I even get a runnable exe inside the build folder. Here's my project file:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
    <OutputType>Exe</OutputType>
    <DefaultLanguageSourceExtension>.ao</DefaultLanguageSourceExtension>
    <OutputPath>C:\Users\filip\source\alto\samples\test\obj\Debug\net5.0\</OutputPath>
  </PropertyGroup>

  <Target Name="CreateManifestResourceNames" />

  <Target Name="CoreCompile" DependsOnTargets="$(CoreCompileDependsOn)">
    <Exec Command="dotnet run --project &quot;$(MSBuildThisFileDirectory)\..\..\src\aoc\aoc.csproj&quot; -- @(Compile->'$(MSBuildThisFileDirectory)', ' ') /o &quot;@(IntermediateAssembly)&quot; @(ReferencePath->' /r &quot;%(Identity)&quot;', ' ')"
          WorkingDirectory="$(MSBuildProjectDirectory)" />
  </Target>

</Project>
Run Code Online (Sandbox Code Playgroud)

Thank you in advance.

Fil*_*oth 6

我没有阅读完整的错误消息。

C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\Microsoft.Common.CurrentVersion.targets(4527,5): error : Expected file "obj\Debug\net5.0\refint\test.dll" does not exist.
Run Code Online (Sandbox Code Playgroud)

它实际上向我指出了引发错误的文件。这是哪里:

C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\Microsoft.Common.CurrentVersion.targets(4527,5): error : Expected file "obj\Debug\net5.0\refint\test.dll" does not exist.
Run Code Online (Sandbox Code Playgroud)

当我不需要参考组件时,它试图制作一个参考组件。所以我只是将该ProduceReferenceAssembly属性设置为false,因为我不需要它。