magic code???
i am running my project in visual studio code exactly the same way with nothing changed, the project has an UI but the important part that sometimes works sometimes not is the fact that sometimes it outputs in the csv files then i delete them and readd them and then it wont work again, i have tried dotnet clean dotnet build restarting machine but i can't find a pattern why sometiems it works sometimes it doesent
8 Replies
Hello
Could you provide more context? What exactly is failing, is it periodic (Works only on first build or works then does not then works then does not...)?
What's the error u get?
It sounds like what you have going on is you have some csv's in your project that aren't being copied to the output directory so it's not failing to load files that aren't there?
This is a wild ass guess, like @Adise said there's not a lot here to go on.
ive deleted and i am trying to figure it out again
i will post updates if i can figure something out
the issue was that it was literally random i couldnt find any type or kind of pattern
ok so there are csv files in my project and the output needs to be stored inside them through this method
sometimes it works sometimes it doesen't i cannot find a pattern i have tried closing opening, dotnet clean dotnet build , restarting pc , recloning the project i have no idea
project runs through avalonia framework if thats relevant i can share the starting poin
i am running the project through vs code so it shouldnt have any permission issue to the csv files
You're going to have trouble referencing files like that, generally navigating up
..
is a bad idea. It implies a directory structure must exist in a place that isn't under your control.
One thing to do is copy the files to the output directory and reference them from the same directory you're executing from
Alternatively you can store them in a dedicated well known and configurable location.Build actions for files - Visual Studio (Windows)
Learn how all files in a Visual Studio project have a build action and the build action controls what happens to the file when the project is compiled.
There's more advanced strategies, like creating files when they don't exist.
i know but when i reference normally it doesent work since we ve added another unit test project in the same folder
while i agree with you i still dont understand why it sometimes wont properly output to the csv files and sometimes it will
I can't help you understand the dithering component, if it's truly non deterministic then you've got other problems, otherwise I suspect you don't understand the circumstances.
It's likely a set of actions that you're taking creating a state where it works the next execution.
Without seeing the code it's hard to tell.
Is this in a git repo public somewhere?