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.

Execute.EmbeddedScript Error: Could not find resource

See original GitHub issue

Hi,

I could not run sql script in asp.net mvc c# in the following context: How do I assign value inside EmbeddedScript ? Below i have attempted various values but failed, the result is the same. the error is: Could not find resource named 201607150000_ERPDomainDB_Initial.sql in assemblies ERPCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null What is the reason ? public class _201607150000_ERPDomainDB_Initial : Migration { public override void Up() { IfDatabase(“SqlServer”) .Execute.EmbeddedScript(“201607150000_ERPDomainDB_Initial.sql”); //IfDatabase(“SqlServer”) // .Execute.EmbeddedScript(“Database.Migrations.201607150000_ERPDomainDB_Initial.sql”); }

}

}

Please help.

Thanks itw2016

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

25reactions
fubar-codercommented, Oct 6, 2018

@mabead Just add .For.EmbeddedResources() to the ScanIn.

7reactions
Vaccanocommented, Mar 19, 2018

OK, I figured this out.

The format of the Embedded Script Name is:

ProjectName.FolderNameIfAny.FileNameWithExtension

So, if my project is called MyDatabase, and my script is in a folder called Views and my script is called dbo.GoodStuff.sql then I would make the call like this:

Execute.EmbeddedScript("MyDatabase.Views.dbo.GoodStuff.sql");

You also have to set the file to have its “Build Action” property set to “Embedded Resource”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FluentMigrator - Execute resource file/script
The Answer is pretty obvious: Accessing the resource-file via Hsk.Migrations.Properties.Resources.
Read more >
Fluent Interface | FluentMigrator documentation
The FM fluent api allows you to create tables, columns, indexes and (nearly) every construct you need to manipulate your database structure. Behind...
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 >
Fluent Migrator for Database Migration
To execute migration, we have “Migrate.exe” which can be found at the path of package folder “packages\FluentMigrator.1.6.0\tools”. Run the ...
Read more >
Visual studio error: Could not find any resources ...
When I create a service-based database and try opening it, I get an error stating the following: Could not find any resources appropriate ......
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