Closed BluejacketScott closed 4 years ago
Well in typical fashion, I'm unable to replicate this. Maybe you can zip-up your project group and send it to me to make sure I'm trying what you're trying correctly.
Here's my project. It currently lives at C:\dev\Courier
Very strange indeed... Thanks for looking into this for me.
Scott
Hi Kelly, I know you're busy but I was wondering if you'd had a chance to take a look at my project and tell me why project groups that include SimplyVBUnit project causes this Permission Denied error? I did some poking around in SVBU and noticed you're using a bit of Assembly as a helper which is very cool but well beyond my comprehension. Could it be that if the test runner doesn't exit cleanly the file remains open because of an open handle in the helper? Way out of my depth here so pardon my ignorance. I'm just trying to think outside the box a little. I tried using ProcessExplorer from Sysinternals to see what was referencing the dll but the only thing it showed was Explorer.exe. That also led me to the concept that maybe my install of git is hanging it. I'm currently using TortoiseGit but haven't tried any others. Open to suggestions...
There should be no references maintained once you exit the test UI. If some how there were a leak, the VB IDE would clear it up or the test UI would not unload. I was able to replicate the issue with a parent-child set of projects without referencing SimplyVBUnit, so I'm thinking it's a lack of clean-up from the IDE. If there is a compile error, then the child DLL would be locked and deny permission. So, I'm hard-pressed to think of a work-a-round of such a scenario. Your project attempts to call XMLUtils.NiceXML` like a static method, but it fails to compile enabling the permission error. I don't think there is a fix this issue as it seems to be VB IDE related.
Thanks for the update Kelly,
Yes, the XMLUtils class has a PredelcaredID set to True so the methods in it get added to the Global Namespace with a default instance. It’s one of the options at the top of the class that you an only see from outside the IDE. Here’s more info on it: https://christopherjmcclellan.wordpress.com/2015/04/21/vb-attributes-what-are-they-and-why-should-we-use-them/
I’m essentially making some of my classes static this way so that SVBU can unit test them. So far I haven’t found a way (but you’d know better than I – for sure – I just haven’t asked yet) how to unit test a regular bas module. It appears that the test runner only accepts test CLASSES and New’s them up on load – no obvious way to supply tests that are tucked away in a module. Unless you have a way that I didn’t see in the docs (which I’m more than happy to update for you)
@kellyethridge , all I'm trying to create a simple dll project with SimplyVBUnit and running into a weird problem. When I open the project group and build the project, everything goes according to plan THE FIRST TIME, but every subsequent build attempt after results in a Permission Denied error in reference to my dll. If I close the project group and reopen it, I can build it ONCE but never again until I restart VB6. Additionally, if I only open the dll project (not the group that contains the test project also) I don't have any trouble building repeatedly. If I re-add the test project to the environment, same problem happens. It seems as if SimplyVBUnit is locking the dll file after the first build. I've verified that the test project is referencing the dll vbp and not the dll directly. Any advice?
Scott