C
C#•2mo ago
rohnaldino

.exe wont run outside of Build Folder even when using Fody?

Question is in title would love to get some help on this as I am confused as shi since it used to work before
16 Replies
rohnaldino
rohnaldinoOP•2mo ago
it runs only when in the build folder but outside of it no which makes sharing the .exe hard
Mayor McCheese
Mayor McCheese•2mo ago
Are you depending on a configuration file that isn't in the same place as the exe?
rohnaldino
rohnaldinoOP•2mo ago
not really no the app kind off opens i can see the Bunifu Snackbar Notifications but it doesnt open completely and eventually closes itself i guess also it created the config on my second pc which makes me think it opens but something i guess stops it
Mayor McCheese
Mayor McCheese•2mo ago
what files are in the build folder?
rohnaldino
rohnaldinoOP•2mo ago
No description
Mayor McCheese
Mayor McCheese•2mo ago
So if you copy all the files out of the folder to a new location it doesn't open?
rohnaldino
rohnaldinoOP•2mo ago
nope LOL it used to work with the .exe alone but even with all the files outside of the build folder it wont open
Mayor McCheese
Mayor McCheese•2mo ago
Do you have the code in a repo somewhere?
rohnaldino
rohnaldinoOP•2mo ago
not really no
Mayor McCheese
Mayor McCheese•2mo ago
It sounds like you're depending on a relative path somewhere What happens when it force closes?
rohnaldino
rohnaldinoOP•2mo ago
nothing its so weird cause it used to work but suddenly it just doesnt anymore i mean i didnt do major changes for it to all in the sudden stop working
Mayor McCheese
Mayor McCheese•2mo ago
Is there anything in the event log?
rohnaldino
rohnaldinoOP•2mo ago
:HMM:
private void LoadCharacterIcons()
{
string resourceFolderPath = Path.Combine(Directory.GetParent(Application.StartupPath).Parent.FullName, "Resources", "dbd");

foreach (var file in Directory.GetFiles(resourceFolderPath, "*.png"))
{
string fileName = Path.GetFileNameWithoutExtension(file).ToLower();
System.Drawing.Image characterImage = System.Drawing.Image.FromFile(file);
characterIcons[fileName] = characterImage;
}
}
private void LoadCharacterIcons()
{
string resourceFolderPath = Path.Combine(Directory.GetParent(Application.StartupPath).Parent.FullName, "Resources", "dbd");

foreach (var file in Directory.GetFiles(resourceFolderPath, "*.png"))
{
string fileName = Path.GetFileNameWithoutExtension(file).ToLower();
System.Drawing.Image characterImage = System.Drawing.Image.FromFile(file);
characterIcons[fileName] = characterImage;
}
}
i assume this is the path ur talking about omg im soo stupid 😭 :ong5head:
Mayor McCheese
Mayor McCheese•2mo ago
It happens It's a bit odd that it just shuts down with no errors though.
rohnaldino
rohnaldinoOP•2mo ago
Real Thats what I‘m saying normally it would show the error
Mayor McCheese
Mayor McCheese•2mo ago
that's part of why I'm asking if it's in a remote repo somewhere like github.
Want results from more Discord servers?
Add your server