Rubberduck: When opening multiple "workbooks" (or Displays in my case) RD Crashes

Created on 10 Jun 2017  路  37Comments  路  Source: rubberduck-vba/Rubberduck

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at Rubberduck.UI.SourceControl.BranchesViewViewModel.RefreshView() in C:\Users\Mathieu\Documents\GitHub\Rubberduck (main)\Rubberduck\RetailCoder.VBE\UI\SourceControl\BranchesViewViewModel.cs:line 55
   at Rubberduck.UI.SourceControl.SourceControlViewViewModel.Refresh() in C:\Users\Mathieu\Documents\GitHub\Rubberduck (main)\Rubberduck\RetailCoder.VBE\UI\SourceControl\SourceControlViewViewModel.cs:line 916
   at Rubberduck.UI.Command.MenuItems.UiDispatcher.<>c__DisplayClass5_0.<InvokeAsync>b__0(Object x) in C:\Users\Mathieu\Documents\GitHub\Rubberduck (main)\Rubberduck\RetailCoder.VBE\UI\Command\MenuItems\UiDispatcher.cs:line 29


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Rubberduck
    Assembly Version: 2.0.13.32288
    Win32 Version: 2.0.13.0
    CodeBase: file:///C:/ProgramData/Rubberduck/Rubberduck.DLL
----------------------------------------
NLog
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.0.0
    CodeBase: file:///C:/ProgramData/Rubberduck/NLog.DLL
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.ServiceModel
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ServiceModel/v4.0_4.0.0.0__b77a5c561934e089/System.ServiceModel.dll
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Serialization
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
----------------------------------------
Microsoft.Vbe.Interop
    Assembly Version: 14.0.0.0
    Win32 Version: 14.0.4760.1000
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.Vbe.Interop/14.0.0.0__71e9bce111e9429c/Microsoft.Vbe.Interop.dll
----------------------------------------
Microsoft.VB6.Interop.VBIDE
    Assembly Version: 5.3.0.0
    Win32 Version: 5.3.0.0
    CodeBase: file:///C:/ProgramData/Rubberduck/Microsoft.VB6.Interop.VBIDE.DLL
----------------------------------------
Rubberduck.VBEditor
    Assembly Version: 2.0.6280.32277
    Win32 Version: 2.0.0.0
    CodeBase: file:///C:/ProgramData/Rubberduck/Rubberduck.VBEditor.DLL
----------------------------------------
Rubberduck.SettingsProvider
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.0.0
    CodeBase: file:///C:/ProgramData/Rubberduck/Rubberduck.SettingsProvider.DLL
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
WindowsBase
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll
----------------------------------------
System.Xml.Linq
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
----------------------------------------
Ninject
    Assembly Version: 3.2.0.0
    Win32 Version: 3.2.2.0
    CodeBase: file:///C:/ProgramData/Rubberduck/Ninject.DLL
----------------------------------------
Ninject.Extensions.Factory
    Assembly Version: 3.2.0.0
    Win32 Version: 3.2.1.0
    CodeBase: file:///C:/ProgramData/Rubberduck/Ninject.Extensions.Factory.DLL
----------------------------------------
Ninject.Extensions.Interception.DynamicProxy
    Assembly Version: 3.2.0.0
    Win32 Version: 3.2.0.0
    CodeBase: file:///C:/ProgramData/Rubberduck/Ninject.Extensions.Interception.DynamicProxy.DLL
----------------------------------------
Ninject.Extensions.Interception
    Assembly Version: 3.2.0.0
    Win32 Version: 3.2.0.0
    CodeBase: file:///C:/ProgramData/Rubberduck/Ninject.Extensions.Interception.DLL
----------------------------------------
Castle.Core
    Assembly Version: 3.2.0.0
    Win32 Version: 3.2.0.14
    CodeBase: file:///C:/ProgramData/Rubberduck/Castle.Core.DLL
----------------------------------------
Rubberduck.Parsing
    Assembly Version: 2.0.6280.32280
    Win32 Version: 2.0.0.0
    CodeBase: file:///C:/ProgramData/Rubberduck/Rubberduck.Parsing.DLL
----------------------------------------
Rubberduck.SourceControl
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.0.0
    CodeBase: file:///C:/ProgramData/Rubberduck/Rubberduck.SourceControl.DLL
----------------------------------------
PresentationCore
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/PresentationCore/v4.0_4.0.0.0__31bf3856ad364e35/PresentationCore.dll
----------------------------------------
Rubberduck.SmartIndenter
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.0.0
    CodeBase: file:///C:/ProgramData/Rubberduck/Rubberduck.SmartIndenter.DLL
----------------------------------------
PresentationFramework
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.dll
----------------------------------------
System.Xaml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xaml/v4.0_4.0.0.0__b77a5c561934e089/System.Xaml.dll
----------------------------------------
Ninject.Extensions.NamedScope
    Assembly Version: 3.2.0.0
    Win32 Version: 3.2.0.0
    CodeBase: file:///C:/ProgramData/Rubberduck/Ninject.Extensions.NamedScope.DLL
----------------------------------------
ICSharpCode.AvalonEdit
    Assembly Version: 5.0.3.0
    Win32 Version: 5.0.3.0
    CodeBase: file:///C:/ProgramData/Rubberduck/ICSharpCode.AvalonEdit.DLL
----------------------------------------
System.Windows.Interactivity
    Assembly Version: 4.0.0.0
    Win32 Version: 2.0.20525.0
    CodeBase: file:///C:/ProgramData/Rubberduck/System.Windows.Interactivity.DLL
----------------------------------------
Antlr4.Runtime.net45
    Assembly Version: 4.3.0.0
    Win32 Version: 4.3.0.0
    CodeBase: file:///C:/ProgramData/Rubberduck/Antlr4.Runtime.net45.DLL
----------------------------------------
System.Net.Http
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Net.Http/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Net.Http.dll
----------------------------------------
Ninject.Extensions.Conventions
    Assembly Version: 3.2.0.0
    Win32 Version: 3.2.0.0
    CodeBase: file:///C:/ProgramData/Rubberduck/Ninject.Extensions.Conventions.DLL
----------------------------------------
Microsoft.Vbe.Interop.Forms
    Assembly Version: 11.0.0.0
    Win32 Version: 14.0.4747.1000
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.Vbe.Interop.Forms/11.0.0.0__71e9bce111e9429c/Microsoft.Vbe.Interop.Forms.dll
----------------------------------------
office
    Assembly Version: 14.0.0.0
    Win32 Version: 14.0.4760.1000
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/office/14.0.0.0__71e9bce111e9429c/office.dll
----------------------------------------
DynamicProxyGenAssembly2
    Assembly Version: 0.0.0.0
    Win32 Version: 3.2.0.14
    CodeBase: file:///C:/ProgramData/Rubberduck/Castle.Core.dll
----------------------------------------
DynamicProxyGenAssembly2
    Assembly Version: 0.0.0.0
    Win32 Version: 3.2.0.14
    CodeBase: file:///C:/ProgramData/Rubberduck/Castle.Core.dll
----------------------------------------
Anonymously Hosted DynamicMethods Assembly
    Assembly Version: 0.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------
WindowsFormsIntegration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/WindowsFormsIntegration/v4.0_4.0.0.0__31bf3856ad364e35/WindowsFormsIntegration.dll
----------------------------------------
Infralution.Localization.Wpf
    Assembly Version: 3.3.0.0
    Win32 Version: 3.3.0.0
    CodeBase: file:///C:/ProgramData/Rubberduck/Infralution.Localization.Wpf.dll
----------------------------------------
PresentationFramework.Classic
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework.classic/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.classic.dll
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
DynamicProxyGenAssembly2
    Assembly Version: 0.0.0.0
    Win32 Version: 3.2.0.14
    CodeBase: file:///C:/ProgramData/Rubberduck/Castle.Core.dll
----------------------------------------
DynamicProxyGenAssembly2
    Assembly Version: 0.0.0.0
    Win32 Version: 3.2.0.14
    CodeBase: file:///C:/ProgramData/Rubberduck/Castle.Core.dll
----------------------------------------
PresentationFramework.Aero
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework.Aero/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.Aero.dll
----------------------------------------
PresentationFramework-SystemXmlLinq
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework-SystemXmlLinq/v4.0_4.0.0.0__b77a5c561934e089/PresentationFramework-SystemXmlLinq.dll
----------------------------------------
PresentationFramework-SystemXml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework-SystemXml/v4.0_4.0.0.0__b77a5c561934e089/PresentationFramework-SystemXml.dll
----------------------------------------
UIAutomationTypes
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/UIAutomationTypes/v4.0_4.0.0.0__31bf3856ad364e35/UIAutomationTypes.dll
----------------------------------------
PresentationFramework-SystemData
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework-SystemData/v4.0_4.0.0.0__b77a5c561934e089/PresentationFramework-SystemData.dll
----------------------------------------
CustomMarshalers
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/CustomMarshalers/v4.0_4.0.0.0__b03f5f7f11d50a3a/CustomMarshalers.dll
----------------------------------------
stdole
    Assembly Version: 7.0.3300.0
    Win32 Version: 7.00.9466
    CodeBase: file:///C:/Windows/assembly/GAC/stdole/7.0.3300.0__b03f5f7f11d50a3a/stdole.dll
----------------------------------------
Microsoft.CSharp
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.CSharp/v4.0_4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll
----------------------------------------
System.Dynamic
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Dynamic/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Dynamic.dll
----------------------------------------
System.Dynamic.DynamicAssembly
    Assembly Version: 0.0.0.0
    Win32 Version: 4.6.1087.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Dynamic/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Dynamic.dll
----------------------------------------
HtmlAgilityPack
    Assembly Version: 1.4.9.5
    Win32 Version: 1.4.9.5
    CodeBase: file:///C:/ProgramData/Rubberduck/HtmlAgilityPack.DLL
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
Rubberduck.resources
    Assembly Version: 2.0.13.32288
    Win32 Version: 2.0.13.0
    CodeBase: file:///C:/ProgramData/Rubberduck/fr/Rubberduck.resources.DLL
----------------------------------------
Rubberduck.resources
    Assembly Version: 2.0.13.32288
    Win32 Version: 2.0.13.0
    CodeBase: file:///C:/ProgramData/Rubberduck/de/Rubberduck.resources.DLL
----------------------------------------
UIAutomationProvider
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/UIAutomationProvider/v4.0_4.0.0.0__31bf3856ad364e35/UIAutomationProvider.dll
----------------------------------------
System.Security
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Security/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Security.dll
----------------------------------------
Microsoft.GeneratedCode
    Assembly Version: 1.0.0.0
    Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
LibGit2Sharp
    Assembly Version: 0.22.0.0
    Win32 Version: 0.22.0
    CodeBase: file:///C:/ProgramData/Rubberduck/LibGit2Sharp.DLL
----------------------------------------
bug feature-source-control

Most helpful comment

I don't think they'd need to be very good to implement this. Most of the functionality exists in some form. The pieces just need put together. I'm sure we could point you in the right direction if you want to give it a go.

For whatever it's worth, I had never written a single line of C# when Retailcoder and I got started.

All 37 comments

This is just a guess here, but the "workbook" names are the same by default. The RD source control defaults the folder as the WB name immediatly. My guess is that because both WB's are the same name that the collision caused RD to crash. This is unavoidable in my case as the base "workbook" name (DisplayCode in my case) cannot be changed.

image

Can the folder be named after the parent file that contains the code, rather than the workbook name?

What reference library are you using to export all the files? Because the first "workbook" definitely exported correctly to the repo folder.

The JIT message is because the exception in the SC panel's ViewModel is unhandled; that error message is from the .net runtime, the part about registering a debugger is for bringing up Visual Studio to debug IL instructions... which you probably don't want to do (it's easier with the source code ;-)

Thanks for reporting it - we need a catch block here:

at Rubberduck.UI.SourceControl.SourceControlViewViewModel.Refresh() in C:UsersMathieuDocumentsGitHubRubberduck (main)RubberduckRetailCoder.VBEUISourceControlSourceControlViewViewModel.cs:line 916

An NRE? We probably need a null check...

@Hosch250 does SC still work off the active project? That's probably where the NRE is coming from; also I agree we don't want "pokemon" catch-all everywhere, but bringing down RD, the VBE and its host for an unhandled exception is just plain dumb, we must not allow our unhandled exceptions to blow everything up. So catch-all and log proper, and null-check where applicable... and ideally get SC to fetch the project with the ProjectID that's under source control, instead of assuming that project is the active project.

With total apprehension to asking this question, could you give me a direction on the tools you use to export all workbooks, modules, class modules, and forms?

It's ultimately the lovely VBIDE API that does it, we've merely wrapped it by implementing its interfaces. This allows us to fix a bug in the API which inserts an empty line whenever importing a userform module. You'll find it all in the VBEditor assembly, under the SafeComWrappers.VBA namespace. Don't hesitate to ask if you have any questions!

Could I ask what the vision is regarding RD's SC export all feature? I ask because this is a feature I will abuse the crap out of if it starts working. The only problem I foresee is that which I mentioned in the original post where if you export all and there are multiple VBAProjectDisplayCode open, it's trying to export all projects into a folder named VBAProjectDisplayCode; theres no unique identifier.

Examples:
excel

In this case it would be better to save the items to a folder named Book1 and Book2 rather than to a folder named VBAProject.

ftvs

Same here, it would be more desirable to save to folders with the Display name (_Eventwatcher.gfx, Order Fulfillment.gfx).

I certainly plan to contribute here. I don't think I am this level of C# programmer, but I'm going to take some stabs at it in my off-time.

I would literally kill for this export all feature. :octocat:

@addohm then 馃敧 some 鈱氾笍 and implement it 馃憤

TBH next release so far isn't addressing much of SC issues - focus has been mostly on parser/resolver and inspection issues, and then IMO we'll have to redesign all WPF docked UIs with WinForms to kill the crash-on-exit issue that's been plaguing v2.0. But we'll get there!...eventually. Indeed, we'll happily take a PR from a contributor that implements that export all (shouldn't be too hard to do) or fixes/redesigns the SC stuff.

@Vogel612 My C# skills aren't that # :(

I don't think they'd need to be very good to implement this. Most of the functionality exists in some form. The pieces just need put together. I'm sure we could point you in the right direction if you want to give it a go.

For whatever it's worth, I had never written a single line of C# when Retailcoder and I got started.

@addohm Does the Rockwell/FactoryTalk library have an Application.Run method (or something similar)? A quick Google suggests Application.ExecuteCommand might be a candidate. If it does, we can help you get Unit Testing working in your host.

@ThunderFrame been there, done that. No, that doesn't work in this case. Thanks though :)

@addohm, if there's an application method that accepts the name of a macro to run, then we just need to add the host details to Rubberduck, and RD would then be able to run unit tests in the host.

@addohm I've been looking at this tonight... RD already has and uses a method to export all modules into a folder... it looks like all it needs is a UI and an internal command, and all that should more or less copy/paste. I think I could hack it together in a few evenings, and I've only been using C# for a few weeks. I encourage you to give it a try. :)

@shadowofsilicon more power to you. The reason this issue exists is because the export all doesn't account for multiple "workbooks" being open, or in my case "displays". My suggestion was to give the root folder for the workbook a unique folder name (the name of the workbook most likely).

There may be a temporary solution to this problem. If I rename each project from "DisplayCode" to something unique (like the name of the Display), it might work.

I did look at the code, and the directory it's supposed to create looks to be Project.Name. In my case it doesn't save that way, so this may be yet another RA specific VB issue.

Will do some testing and follow up.

@addohm source control is borked IMO. We should have never used Project.Name for anything; SC was basically designed to work off the active project, pretty much assuming there would only ever be 1 project in the VBE at any given time. SC needs a complete overhaul I'd say.

What application are you running RD in? FactoryTalk View Studio from Rockwell Automation?

Source control is definitely borked...

@retailcoder You could be right, it's been a task getting it to work. I'm just using it for it's export feature for now. I export to a folder, then I commitpush in Git Bash when I'm ready.

@shadowofsilicon Yes. Matt knows as I've talked to him in the past about it.

@addohm What version? I can probably get access to a copy via my workplace. That would def help with debugging RD. :)

@shadowofsilicon I'm using V9 right now. When I started this project six months ago, it was V8.20. This project is Standard Edition Local. I can provide you a copy probably. It's not really locked down. It's got a 7 day grace period that resets every time you close and re-open the application. lol

Okay, so that didn't work, and in fact what I thought was the problem didn't actually cause the crash, I don't think. What causes the crash is if you are selecting a folder that doesn't exist. I.e. the folder selector doesn't force the existence of the content that is typed in the "Folder:" input box.

The export feature only exports whatever project you have highlighted in the project tree. It doesn't actually try to export all projects.

I was right in that changing the Project title changes the folder that it creates. Still a problem if there are duplicates, which in general there would be since everything by default is called Workbook (or DisplayCode in my case).

Click Here I won't be serving this for more than a few days so grab it while you can :)

Actually in Office hosts all project names default to VBAProject - which was the basis for the "project has default name" inspection, knowing that this would be a problem with SC relying on project name... which again was a big mistake made early on.

I'll try to sneak a little commit into the next release for that "export all" feature.

Omg 馃檹馃檹馃檹馃檹馃檹 Bless you. Where do I donate for this project anyway? :D

Current build doesn't seem to exhibit this crash - typing a non-existant folder name in the Create New Repository dialog shows this:

image

Can this be closed?

@mansellan I think if you read through the convo you'll see we deduced the problem to something different than my OP.

Thanks @addohm

Was responding to your comment near the end of the thread (12/07):

Okay, so that didn't work, and in fact what I thought was the problem didn't actually cause the crash, I don't think. What causes the crash is if you are selecting a folder that doesn't exist. I.e. the folder selector doesn't force the existence of the content that is typed in the "Folder:" input box.

This doesn't seem to happen any more?

No. If I remember correctly, the software is only capable of exporting a single project at the moment.

@mansellan I think I remember now. The software loops through workbook names, but default workbook names cause a collision obviously, because the folder is named the workbook name. I think the TLDR of this was to name the folder the same as the file name (foobar or foobar.xls) rather than the workbook name.

OK thanks

Does anyone know if this is this an issue with exporting or with SC?
(Or if it's still an issue at all?)
I'm trying to clean up all SC issues that aren't actually Export issues due to #3758.

FWIW this issue is a little bit very convoluted and has multiple subbranches of conversation. I'd prefer to close and open a new issue if this is something that's still TBD

Was this page helpful?
0 / 5 - 0 ratings