question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migrations don't compile. 'Unable to create a manifest resource name for %MIGRATION_FILE%.resx'. Could not find a part of the path '%MIGRATION_FILE%%.cs'

See original GitHub issue

We are getting the following build errors when trying to compile our EF6 project on .NET Core Preview 9 (also tested nightly build 6.3.0-rc1-19455-01, tested both Windows and Mac).

  Microsoft.CSharp.CurrentVersion.targets(100, 9): [MSB3041] Unable to create a manifest resource name for "Migrations\201806250240525_MigrationName1.resx". Could not find a part of the path 'C:\...PathToProject...\Migrations\Migrations\###############_MigrationName1.cs'.
  Microsoft.CSharp.CurrentVersion.targets(100, 9): [MSB3041] Unable to create a manifest resource name for "Migrations\201806250240525_MigrationName2.resx". Could not find a part of the path 'C:\...PathToProject...\Migrations\Migrations\###############_MigrationName2.cs'.
...
  Microsoft.CSharp.CurrentVersion.targets(100, 9): [MSB3041] Unable to create a manifest resource name for "Migrations\201806250240525_MigrationName5.resx". Could not find a part of the path 'C:\...PathToProject...\Migrations\Migrations\###############_MigrationName5.cs'.

It seems the paths being looked for includes ‘Migrations\Migrations\’ twice, which indeed doesn’t exist.

Further technical details

EF version: Tried both 6.3.0-preview9-19423-04 and 6.3.0-rc1-19455-01 Database Provider: System.Data.SqlClient (SQL Server) Operating system: Tried both Windows 10 and MacOS Mojave 10.14.6 IDE: Rider 2019.2.2

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
marchycommented, Sep 5, 2019

@divega confirmed that putting the files in the root directory avoids the problem – though obviously not an acceptable workaround since we have tens of migrations and would change + pollute the project structure.

The workaround of manually adding the dependent-upon references also avoids the issue, as mentioned above (more acceptable):

<ItemGroup>
    <!-- TEMP: workaround for https://github.com/microsoft/msbuild/issues/4488 -->
    <EmbeddedResource Update="Migrations\###############_MigrationName1.resx">
      <DependentUpon>###############_MigrationName1.cs</DependentUpon>
    </EmbeddedResource>

    ....

    <EmbeddedResource Update="Migrations\###############_MigrationName5.resx">
      <DependentUpon>###############_MigrationName5.cs</DependentUpon>
    </EmbeddedResource>
  </ItemGroup>
1reaction
bricelamcommented, Sep 6, 2019

The resource names will be wrong (as they were in preview8) causing new ResourceManager(typeof(MyMigrationClass)) to fail

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to create a manifest resource name error in Visual ...
It basically means it can't find your files. 1. Try to close and reopen the project. 2. Re-add the files via Add ->...
Read more >
[Solved] C# Error: Unable to create a manifest resource name
I`ve updated the project(Reports folder) but when I want to build it, it shows this error and the error is not about my...
Read more >
when build project error manifest display why and how to ...
Could not find a part of the path 'C:............\Form1.cs'. Unable to create a manifest resource name for "Form1.resx". The file or directory ...
Read more >
Visual Studio 2010: Unable to create a manifest resource ...
I've done a Ctl+F search for the form name across the entire solution and "FrmList does not show up. I'm totally stuck. Any...
Read more >
How to fix: “Could not find any resources appropriate for the ...
In this post we´re going to see a common error that may pop up when using resource files in ASP.NET MVC. Could not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found