Rider looking in obj for project dependency rather than bin (works in Visual Studio)

I've got a C# solution that targets multiple platforms. The project structure is like:

Project.Common - the main UI & implementation code (built in Avalonia), referenced by various small platform-specific projects

Project.Android - small platform-specific project that targets Android (and so on for other platform-specific targets)

 

When I build, deploy, & run this solution to Android in Visual Studio it works fine. When I try to do the same in Rider, I get `Microsoft.Common.CurrentVersion.targets(4857,5): Error MSB3030 : Could not copy the file "obj\Debug\net8.0\Project.Common.dll" because it was not found.`

Notice that it's looking for the dll in obj (presumably rather than bin, which is where it actually is). Why is it looking for it in obj? Why does the same solution work as-is in Visual Studio?

 

Thanks in advance

0
7 comments

Hello J92,

Please check if the issue persists with Settings | Build, Execution, Deployment | Toolset and Build → Use ReSharper Build.

If it does, please share a sample project affected by this issue with us. You can send us the project via the Upload Service and let us know the Upload ID. The upload will be private and used solely to investigate this case and (if this is a bug) fix the issue.

0

Thanks for the quick reply! :)

> lease check if the issue persists with Settings | Build, Execution, Deployment | Toolset and Build → Use ReSharper Build.

That option was already disabled (as a side note, it really seems like that option shouldn't be enabled by default for new installs - it makes builds incredibly unreliable. After moving over from VS to Rider I spent quite some time tearing my hair out over random unexplained bugs, which ultimately came from code changes not being applied to my builds, or being only partially applied. Disabling that option made things reliable again.)

> please share a sample project affected by this issue with us.

Are there any other investigatory steps I can take on my end? I'm not really comfortable sending out this whole project :/

Thanks again

0

I managed to get it working by adding this workaround to the Project.Common.csproj file - still not really sure why it works as-is in Visual Studio without this, but at least a temporary workaround:

  <Target Name="CopyAvaloniaOutputToStandardLocation" AfterTargets="Build">
    <!-- Copy the main assembly -->
    <Copy SourceFiles="$(IntermediateOutputPath)Avalonia\$(TargetFileName)" 
          DestinationFiles="$(IntermediateOutputPath)$(TargetFileName)" 
          SkipUnchangedFiles="true"
          Condition="Exists('$(IntermediateOutputPath)Avalonia\$(TargetFileName)')" />
    
    <!-- Copy the reference assembly -->
    <Copy SourceFiles="$(IntermediateOutputPath)refint\Avalonia\$(TargetFileName)" 
          DestinationFiles="$(IntermediateOutputPath)refint\$(TargetFileName)" 
          SkipUnchangedFiles="true"
          Condition="Exists('$(IntermediateOutputPath)refint\Avalonia\$(TargetFileName)')" />
  </Target>
0

J92, thank you for the update.

Would you mind reproducing this issue again and sharing the binary logs with us? They should help us identify the cause of this behavior. Please follow the steps below to collect the diagnostics:

  • Temporarily remove the CopyAvaloniaOutputToStandardLocation workaround
  • Open your solution in Rider
  • Build the solution via Build | Advanced Build Actions | Build Solution with Diagnostics
  • Collect Rider logs via Help | Collect Logs and Diagnostic Data

If you are able to build and publish your project via CLI:

  • Build your solution using dotnet build -bl as described in Capturing Binary Logs for command-line builds. Please make sure that you are building the same project configuration as you are in Rider (e.g. Release)
  • Collect the generated bin log file

If you are not able to build and publish your project via CLI, please use VS to collect the bin log:

  • Install the Project System Tools extension in VS
  • Set MSBuild project build output verbosity and MSBuild project build logs file verbosity to Diagnostic in Visual Studio | Tools | Options | Projects and Solutions | Build and Run
  • Open the newly added View | Other Windows | Build Logging window and press ▶ to start build logging (see the first few screenshots in Project System Tools as a reference)
  • Invoke Build | Build Solution
  • When VS finishes building, find the entries that correspond to the Common and Android projects in the Build Logging window
  • Right-click on them and select Save Logs... to save the bin log

You can send us the diagnostics using the Upload Service and mention the upload ID in this thread.

0

I went ahead & collected those logs - however, they're prohibitively massive in terms of being able to do any sensible privacy review (i.e. almost 190 megs). If there's a much more targeted log I could quickly review & send over I'd be happy to do that, otherwise I'll probably just settle for the workaround for now in favor of saving time. I'm one of those nuts who prefers not to send out data collected from my system without being able to sanity check what that data actually is. Hope that makes sense.

0

Regrettably, it is not possible to easily collect a very limited log or anonymize the binlog. However, if you are willing to investigate this with us, please consider:

  • Looking up what happens with Project.Common.dll in both binlogs - one collected in Rider and the one collected without it. Please describe what happens with this file in each log. This should give us a starting point to figure out what exactly happens in your environment.
  • If possible, please share the .csproj files of Project.Android and Project.Common via the Upload Service. These files should be easier to review.
0

I'll just stick with the workaround for now to avoid sinking too much more time into this - thanks for being willing to dive into it for me tho :)

0

Please sign in to leave a comment.