Execute.EmbeddedScript Error: Could not find resource
See original GitHub issueHi,
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:
- Created 7 years ago
- Comments:12 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mabead Just add
.For.EmbeddedResources()
to theScanIn
.OK, I figured this out.
The format of the Embedded Script Name is:
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”.