I have an .xlsx file stored in my project and need to open and read it in a C# class in order to properly set my environment when running a test both locally and remotley. The excel file contains a list of commands that my class needs to read through and run on a host.
I've included the .xlsx file in my project folder and when I run it locally. I am able to refer to it as 'fileName.xlsx' and it finds and accesses it as expected. Unfortunately, when I run the same project via remote agent it is unable to find the file. Ideally I'd like a solution where I can pass in the file as a file location like I'm currently doing now rather than trying to load it in as a datasource.
How to include non C# files when running to a remote agent
Re: How to include non C# files when running to a remote agent
Hello Bumler ,
Have you added it to your project as an existing item: After adding it, it should be visible in the project view: Then you must open the properties of the excel file by right clicking on it in the project view and navigating to "Properties".
Make sure to set the "Copy to output directory" option to "Always": You should now be able to use only the file name as the path value of any method you are using in your code since your methods will access directly the file from the output directory.
Regards,
McTurtle
Have you added it to your project as an existing item: After adding it, it should be visible in the project view: Then you must open the properties of the excel file by right clicking on it in the project view and navigating to "Properties".
Make sure to set the "Copy to output directory" option to "Always": You should now be able to use only the file name as the path value of any method you are using in your code since your methods will access directly the file from the output directory.
Regards,
McTurtle
You do not have the required permissions to view the files attached to this post.