visual studio code - Unable to load sample data into dotnet core app when running in debugger but runs fine in terminal -
i have dotnet core project i'm important sample data xml.
xdocument sampledata = xdocument.load(@"seed/import_sampledata.xml");
in terminal when execute command dotnet run loads data fine expected in visual studio code different results when try run debugger:
unhandled exception: system.reflection.targetinvocationexception: exception has been thrown target of invocation. ---> system.io.filenotfoundexception: not find file '/users/chris/google drive/repos/project/project.api/seed/import_sampledata.xml'.
i'm not sure issue being thought debugger uses dotnet run why behave differently?
as suggested here's copytooutput settings in project.json. xml file copied bin folder on build still returns file not found exception:
"copytooutput": { "include": [ "config.json", "certificate.pfx", "seed\\" ] }
i figured out... have 2 library projects , api project under 1 subfolder. debugger starting @ root workspace folder holds 3 projects. changed cwd start in api project since other projects pulled via dependencies , found xml files in project.
Comments
Post a Comment