I'm using Fluent Migrator 1.6.2 in my .Net application.
For migrating up or migrating down the database, Migrate.exe needs to be executed by passing assembly file (the dll file of the database project in which the migration classes exist) from the command line.
And by default, Migrate.exe file gets created inside \packages\FluentMigrator.1.6.2\tools folder.
I want both these files (Migrate.exe and DbProject.dll) to be created inside the same folder.
Is there any configuration setting in fluent migrator by which I can control the location at which Migrate.exe file gets created and create it inside my DB project?
No such configuration exists. You however, can set a specific folder in your solution, where you copy the Migrate.exe file and other needed files, then set the properties of your Migrations project, to build to said folder, resulting in binaries generation every time you build the application.
Recommendation here is to have the migrations in their stand alone project inside your solution.
Related
I created a .NET Core 3.1 console application that contains a default appsettings.json configuration file in the same directory as the executable. When the application starts up, it will look for the configuration in the users' AppData/Local/<appname> folder, and if the application cannot find the configuration file there, it will copy the default configuration file to the local AppData folder.
This works fine, but I would like to distribute the application as a single executable file (using dotnet publish /p:PublishSingleFile=true ...). The problem is I cannot access the default configuration file anymore. When I open the single published file in a hex editor, I can see the content of the default configuration in there, so I know the default configuration file is somehow included in the published single file.
Is it at all possible to access included files while publishing the application as a single file?
When the self-contained executable starts, the first thing it does is to extract its content to a temporary directory. This is documented here.
As for getting the path of the temporary folder itself, where all your files will be extracted, just use Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName) as referenced here.
It's time to learn ASP.NET Core, so I create test project. When I learn project structure I found then folder for static files (wwwroot) marked as ignored.
StaticFiles package was added as well as UseStaticFiles method was called on Configure. Why this happend? How should I fix tis?
Once you will add static files inside the folder, it will no longer be ignored by your Source Control Manager.
I have a question about flyway migration folder . Does sql's have to reside in project folder Application/foo/bar/main/resources/db/migration. Could it reside outside of the application cource folder?
We are using Maven.
By default Flyway will look for migrations on the classpath under db/migration, which on a Maven project means src/main/resources/db/migration.
You can however also use a location starting with the filesystem: prefix that can be anywhere on your disk.
See the ”Location and discovery“ section of the SQL-based migrations documentation page.
For command-line use, see the locations option on the migrate command reference page.
I've been using Eclipse indigo with m2e and m2e-wtp installed.
I created a dynamic web project using m2e by selecting maven-archetype-webapp. Now the problem is, I could not see src/main/java, src/test/java and src/test/resources in the created structure. Here is a snap of the project.
I stumble around and found this link. I created required directories on file system. Now the question is ideally where should I add "Source Folder" for each directories(src/main/java, src/test/java and src/test/resources)? Should I add them under "Java Resources" or somewhere else?
Thanks
That's exactly how we do it.
src/main/java, src/test/java and src/test/resources
under java resources -> new source folder
Don't forget to add your src/main/java path and the maven dependencies to the deployment assembly of your project if you want to run the web app from eclipse via tomcat.
EDIT
Concerning Eclipse Deployment:
If the project is already facetted as a Dynamic Web Project like yours, you'll need to add a Server in the Server view (We use Tomcat 7 and reference a local tomcat copy in the server setup)
Then you add the web projeect to the server (add/remove on the server)
In the project properties you'll need to add the src/main/resources and src/main/java folders to your deployment assembly as well as the maven dependencies.
We also use a src/main/webapp folder instead of the webcontent folder that is automatically created. This holds the web resources, WEB-INF and views and will be added to the deployment assembly as well and mapped to the root path '/'
Now you'll run an install on your app and then select 'run on server'
Just after the creation of a web application based on the archetype 'maven-archetype-webapp', it is perfectly possible to run the wep application in making usage of 'run as' on Tomcat (by example). You have right to a jsp page, index.jsp.
But if you want like many others create a servlet then you have a problem. The build path of the projects references 'src/main/java' and 'src/test/java' but the directories do net exist yet. I don't know why they forgot to create the directories (within the archetype)...
To correct the problem, you 'simply' have to create the missing directories (from the explorer) and then from Eclipse do a right-click on the project name and then click on 'Maven' and then 'Update Project'. If you create the directories this way you will see that the source directories (src/main/java and src/test/java will appear again).
Then create a new servlet (by example) in src/main/java and deploy the application again. Everyting will work this time.
We have an installer for a website of ours which works great, I exclude the web.config and a few other files when creating the installer. However I can't seem to exclude a folder. Is this possible?
I've created the installer using the .NET built in Web Setup Project found in the visual studio group Other project types > Setup and Deployment within the new project dialog. This only has the option of including groups of output and excluding files via the filter.
What technology are you using to generate your installer?
Edit after additional info in the question: OK, I haven't worked with the built in Web Setup Project, but I did use a regular setup project once. You control the output of each project that's included in the setup by setting the Build Action property of each content file. Set it to None to exclude a file.
There isn't a Build Action property for a folder, so you'll have to set it for all the files within a folder. If a folder doesn't have any content files, then it shouldn't be included in your setup project.
The only way I found to exclude entire folders and any files within sub-directories was to modify the deployment project which fed into my Installer. Check out the following for information removing folders pre-build:
http://www.meadow.se/wordpress/?p=137
And this for post-build:
http://blogs.msdn.com/webdevtools/archive/2008/10/05/exclude-files-and-folders-from-wdp-output.aspx