Fails to run .NET6 Console Application in debug mode "One or more errors occurred"
I have a .NET6 Console Application which builds fine and runs fine using Run in Rider. However if I try to start a Debug session it fails. The application still builds ok but the application do not start and the Debug windows only states "One or more errors occurred.". No further details what I can find so no clue to what goes wrong. Anyone knows what I could change/investigate?
Please sign in to leave a comment.
Hello Patrik,
Thank you for reaching Rider Forum.
Could you please reproduce the issue and collect the logs from Help > Collect Logs? Upload them then to our storage and provide me with the upload ID.
Thank you in advance!
Hi! Thanks for the response and sorry for the delay (summer vacation :-)). Here is the logs after I tried to Debug the project
Upload id: 2023_08_08_etowTwFp1NVpSApMGczy5G (file: rider-logs-20230808-0835187611513861208519928.zip)
I started having exactly the same problem yesterday. An application that ran fine in Rider previously suddenly stopped working yesterday.
Hi there,
thank you for the logs. Could you clarify if there is a property PublishSingleFile in your csproj file?
This might be the problem. Could you also share the csproj?
Hi Sofia! Yes I have that setting in my configuration. The csproj file looks like this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>1.0.12</VersionPrefix>
<VersionSuffix></VersionSuffix>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<PublishSingleFile>true</PublishSingleFile>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPublishable>True</IsPublishable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Karambolo.Extensions.Logging.File" Version="3.4.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.3" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<None Update="AppSettings\AppSettings.Production.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="AppSettings\AppSettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="AppSettings\AppSettings.PreProd.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
I can confirm that if I remove that setting (PublishSingleFile) it is possible to start and debug the project!
Thank you for the information. Unfortunately, you faced the known issue https://youtrack.jetbrains.com/issue/RIDER-56918/Cannot-start-debugging-net5-project-on-Linux-when-using-PublishSingleFile-in-.proj-file. We are planing to fix it in the future release.
Please clarify if this is possible for your workflow to add a condition like true for this parameter so that you can develop your project within Rider using for example Debug configuration?