Page 1 of 1

Net 4 exe hangs when run from shared folder.

Posted: 22. Aug 2016, 11:32
by Ernis
Hi.
I have a Net 4 app that hangs when I try to run it from a shared folder on a Virtual Box machine.
I have tried to convert the app to Net 3.5 and then it runs fine. When I convert it back to Net 4 it hangs again.
Also, if I copy the app to the disc of the virtual box machine, it runs fine.
I run the app from an Admin account. The shared folder is auto mounted.
I've tried this on a virtual box with win7 and one with win 8.1.
I've done some debugging and it appears to be when I do a Assembly.LoadFile() in the code of the app that it hangs.
I'd really appreciate it if someone could give me some tips on how to attack this.
Thanks

Re: Net 4 exe hangs when run from shared folder.

Posted: 22. Aug 2016, 11:45
by Martin
Shared folders are just a simple solution to copy files between host and guest. They don't implement many advanced filesystem features like access control and locking which may be expected by programs trying to use files on a shared folder.

Re: Net 4 exe hangs when run from shared folder.

Posted: 22. Aug 2016, 13:26
by scottgus1
It should be noted that the kind of "shared folders" Martin was referring to, with the limitations in running programs, are the Virtualbox Guest Additions Shared Folders.

Regular Windows-style shared folders should allow running install programs & other such into and out of a Virtualbox guest just fine - I do it all the time.

Guest Additions Shared Folders do not require a network between host and guest, but also don't allow all that can usually be done with a real shared folder. Guest Additions Shared Folders were designed just for file transfer between host and guest. Real shared folders set up between the two OS's without using any Virtualbox Guest Additions utilities require a good Virtualbox network, but also allow full functionality.

Re: Net 4 exe hangs when run from shared folder.

Posted: 22. Aug 2016, 13:46
by socratis
scottgus1 wrote:Regular Windows-style shared folders should allow running install programs & other such into and out of a Virtualbox guest just fine - I do it all the time.
Not all of them. I'll try and find an broadly used example and update the post.

Re: Net 4 exe hangs when run from shared folder.

Posted: 22. Aug 2016, 13:57
by scottgus1
socratis wrote:Not all of them.
Interesting. Will stay tuned...

Re: Net 4 exe hangs when run from shared folder.

Posted: 23. Aug 2016, 07:59
by Ernis
Thanks for your comments.
I've always used the shared folders for file transfer and run my apps from the virtual box disc. However, other users dont so I must take that into account. As I said, it has worked up until I changed Net framework to 4 and I cant find any documented changes in Net that would account for this behaviour.
Any ideas of how to attack this would be appreciated.

Re: Net 4 exe hangs when run from shared folder.

Posted: 23. Aug 2016, 11:13
by socratis
scottgus1 wrote:
socratis wrote:Not all of them.
Interesting. Will stay tuned...
OK, I don't have an available app right now to point you to, but I definitely remember seeing it. It has to do with UNC shares and sometimes UAC control. I'll keep my eyes open until I hit a specific example. In the mean time, here's a potential explanation from TechNet: https://technet.microsoft.com/en-us/lib ... 10%29.aspx

Re: Net 4 exe hangs when run from shared folder.

Posted: 26. Aug 2016, 12:16
by Ernis
Thanks. I've tried to deactivate UAC with no effect.
I also thought that the UNC path was the problem but I find it hard to see that a dotNet upgrade to 4 should induce this. If I build my app with 3.51 it runs just fine from the share but not with 4.