I am developing a .NET 3.5 application in Visual Studio 2015, which among other things reads from a database and with the information generates an excel. I'm having a problem generating the Excel file, the funny thing is that when I run the application from the virtual machine, a VMware® Workstation 14 Pro, it generates good excel in the host's path, however when I launch the compiled on the host it gives me an error, and it has to do with how the path to save the file is formed.
Currently the route is calculated like this:
ruta = AppDomain.CurrentDomain.BaseDirectory;
wb.SaveAs(ruta + @"\Informe_" + DateTime.Now.Hour.ToString() + "_" + DateTime.Now.Minute.ToString() + "_" + DateTime.Now.Second.ToString() + ".xlsx");
As I said when I launch the program from the VS2015 it generates the report correctly, however when I launch it from the host it gives me the following error:
Finally I was able to debug a bit and what you see is that the route is created incorrectly.
Thank you very much.
Note. You see a black line in the image, that I have painted to remove the name of the client and to see that there is a normal text, without strange symbols or anything.