I am currently accessing the File by using the relative path, kindly refer the below code snippet.
var filePath = @"..\..\..\..\..\..\..\..\Common\Data";
When I build the project with ANYCPU
it works fine,but when I change the configuration manager to x64
or x86
the file cannot be found because in bin folder the x64/x86
folder is created so that the file cannot be found. However, adding extra dots it works fine. Kindly refer the below snippet.
var filePath = @"..\..\..\..\..\..\..\..\..\Common\Data";
Can you please provide the solution that how to detect the configuration manager is x64/x86
programmatically in c#
?