'Error: Unhandled Exception: System.IO.FileNotFoundException: The configuration file 'onfig' was not found and is not optional

Error when executing

.\migration.exe execute –config .\configuration.json

Unhandled Exception: System.IO.FileNotFoundException: The configuration file 'onfig' was not found and is not optional.

Screenshot:

Error Screen



Solution 1:[1]

When you try to use the configuration.json file in one project and set the startup project as another project. You will come across this error.

The error stack might be somewhat different for you based on your implementation but the solution will be the same. Right-click on the configuration.json file and click on Properties. This solution uses Visual Studio.

enter image description here

Check the property Copy to Output Directory. It might be Do not copy. Change this to Copy always.

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kangcheng Jin-MSFT