Question IO Doesnt work on x64 or on x86 configaration only on Any CPU RRS feed

vlad.ua96

Member
Joined
Nov 22, 2020
Messages
5
Programming Experience
3-5
Hello) Recently i got very strange error with IO i noticed that when i change project configuration from Any CPU to x64 or x86

input output stop working. I can't create any files even this simple code not working.
File.WriteAllText(@"CSVTEST.csv","test");

I was thinking to change project configuration back to Any CPU but unfortunatelly i can't do it because i am using Microsoft ML library which works only on x64 or x86 configurations. So it's kinda impossible for me to stay on Any CPU configurations.
Maybe someone already had this problem, on internet i didn't find any information about this
I also was thinking about change configuration dinamically but i think it's kinda bad codding. Not to mention this will not work stable
 
Hello) Recently i got very strange error with IO i noticed that when i change project configuration from Any CPU to x64 or x86

input output stop working. I can't create any files even this simple code not working.
File.WriteAllText(@"CSVTEST.csv","test");

I was thinking to change project configuration back to Any CPU but unfortunatelly i can't do it because i am using Microsoft ML library which works only on x64 or x86 configurations. So it's kinda impossible for me to stay on Any CPU configurations.
Maybe someone already had this problem, on internet i didn't find any information about this
I also was thinking about change configuration dinamically but i think it's kinda bad codding. Not to mention this will not work stable
Turns out when you change project configuration you should use absolute path even if files are in project folder Worked for me. File.WriteAllText(@"C:\Users\VladMishyn\Desktop\DIPLOM1\ASIX\ASIX\bin\Debug\CSVTEST.csv", "test");
 
Default output path bin\Debug changes to bin\x86\Debug or bin\x64\Debug (and same for bin\Release).
 
Or instead of hand copying your "CVSTEST.csv" into the output path, actually use the Visual Studio feature to "Copy if newer" or "Alway copy" option when building. This this take care of putting the file into the correct place.
 
Back
Top Bottom