C
C#•4d 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•4d ago
it runs only when in the build folder but outside of it no which makes sharing the .exe hard
Mayor McCheese
Mayor McCheese•4d ago
Are you depending on a configuration file that isn't in the same place as the exe?
rohnaldino
rohnaldinoOP•4d 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•4d ago
what files are in the build folder?
rohnaldino
rohnaldinoOP•4d ago
No description
Mayor McCheese
Mayor McCheese•4d ago
So if you copy all the files out of the folder to a new location it doesn't open?
rohnaldino
rohnaldinoOP•4d 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•4d ago
Do you have the code in a repo somewhere?
rohnaldino
rohnaldinoOP•4d ago
not really no
Mayor McCheese
Mayor McCheese•4d ago
It sounds like you're depending on a relative path somewhere What happens when it force closes?
rohnaldino
rohnaldinoOP•4d 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•4d ago
Is there anything in the event log?
rohnaldino
rohnaldinoOP•4d 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•4d ago
It happens It's a bit odd that it just shuts down with no errors though.
rohnaldino
rohnaldinoOP•4d ago
Real Thats what I‘m saying normally it would show the error
Mayor McCheese
Mayor McCheese•4d 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