.net.net-core

Why am I getting "Resource file" resx error when running .net core console app on linux?


dotnet run --project ProjectName.csproj

The error I get is:

/usr/share/dotnet/sdk/2.2.301/Microsoft.Common.CurrentVersion.targets(3046,5): error MSB3552: Resource file "**/*.resx" cannot be found. [/path/ProjectName.csproj]

My ProjectName.csproj does not contain any resources:

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.2.0" />
    <PackageReference Include="MongoDB.Driver" Version="2.8.1" />
    <PackageReference Include="ServiceStack.Kestrel" Version="5.5.0" />
    <PackageReference Include="ServiceStack.Server" Version="5.5.0" />
  </ItemGroup>

  <ItemGroup>
    <None Update="appsettings.Development.json">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="appsettings.Production.json">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>

</Project>

Solution

  • The project folder had a folder called 'd:\something'

    $ ls
    ProjectName.csproj   'd:\something'
    

    After removing that folder, the app started.

    The folder was not referenced/mentioned by the csproj nor any source file.