November 12, 2017 at 01:43 #12965
I just created a new custom template and when I try to use it I get the following exception:
VisualGDB version: 22.214.171.1241
—————— System.NullReferenceException ——————
System.NullReferenceException: Object reference not set to an instance of an object.
at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object component, Object value)
at System.Windows.Forms.RadioButton.PerformAutoUpdates(Boolean tabbedInto)
at System.Windows.Forms.RadioButton.set_Checked(Boolean value)
at v31.q(EmbeddedUserProjectTemplate c, Boolean e, CLanguageStandard d, ImportedExternalProject b, String a)
at VisualGDB.Wizard.Embedded.EmbeddedProjectWizardImpl.k.h(ej a)
at ej.a1_2(g1 a)
at v31.a1_2(g1 a)
at w31.b1(Int32 a)
I have attached the template.
SidNovember 12, 2017 at 01:45 #12966
Seems your server didn’t like my file, trying as a ZIP file.
Attachments:You must be logged in to view attached files.November 12, 2017 at 05:49 #12969
Thanks, looks like our bug. Please try this build: http://sysprogs.com/files/tmp/VisualGDB-126.96.36.1995.msiNovember 12, 2017 at 15:55 #12970
Thanks that fixed the exception, however I needed to add some extra files to the template and after I edited it to add those I get a new exception:
VisualGDB version: 188.8.131.525
—————— System.Exception ——————
System.Exception: Invalid project template file
at VisualGDB.Backend.UserProjectTemplate.FromPackage(String fn)
at VisualGDB.WPF.Wizards.Embedded.EmbeddedProjectTypePage.ControllerImpl.CommitPage(m commitMode)
at v6.i_2(m a)
at xc1.l1(Int32 a
The edited template is attached,
Attachments:You must be logged in to view attached files.November 12, 2017 at 18:57 #12974
The attached template file is indeed broken (has contents inside a subdirectory). To troubleshoot this type or problems please try creating a new template, rename it to .zip and compare its contents with your edited template side-by-side.November 12, 2017 at 19:14 #12975
So I can’t have files in sub-folders in a template?
SidNovember 14, 2017 at 02:23 #12986
Please can you confirm if the template allows for content in sub-folders. I need to have some files in my template that are not in the project root.
SidNovember 14, 2017 at 19:22 #12992
You can add subfolders to the template file as long as you don’t move other files inside it. E.g. the template.xml file needs to be always in the root directory of the template.
Generally if you are not comfortable manually editing the templates, please rely on VisualGDB to generate them automatically – add all necessary files to the Visual Studio project and then create a template. Hacking the template files manually is possible, however is more error-prone than generating them automatically and we generally don’t recommend doing it unless you are ready to troubleshoot errors caused by unexpected modifications.November 15, 2017 at 16:41 #12995
I am more than comfortable “hacking” template files given the correct information.
In reply to my question; Please can you confirm if the template allows for content in sub-folders … you wrote “You can add subfolders to the template file as long as you don’t move other files inside it”
I did not move any files into the sub-folders I created that were a part of the VGDB template, I only added the files I needed.
So, can sub-folders have content (including otehr sub-folders) inside them?
Second point, the original template I tried was generated from a project that had all the files and sub-folders I needed in the template, however, the template did not have those sub-folders or files included. You then told me to add them manually, which I did.
Please clarify what may or may not be added to the template, any file in the generated template being left where it is.
SidNovember 15, 2017 at 21:48 #12996
Yes, the template allows adding sub-folders, however the folders shown in Solution Explorer don’t always correspond to the physical subfolders on the disk. VisualGDB automatically preserves both when creating/restoring templates, however if you want to edit the templates manually, please ensure you understand the difference between them as confusing the paths would make the template unreadable.
To diagnose corrupt templates, please download 7-Zip and run the following command line for both working and a broken templates:
7z.exe l <template file>
This will list the contents of both files. Please carefully compare the outputs for the 2 template files (and the unpacked template.xml files) and double-check all differences.
As we may change the internal template format in the future, we don’t provide specific instructions on editing it manually and don’t guarantee that this will always work, sorry. The only officially supported way of doing this is using VisualGDB template export GUI. We made the template format easily editable (zip+xml) to make advanced tweaking possible, however this is something to do purely at your own risk. If the inconvenience from troubleshooting accidentally broken templates doesn’t outweigh the advantages of manual tweaking, please don’t use this feature and use the GUI instead.November 16, 2017 at 17:24 #13006
I would LOVE to use the template GUI in VGDB, however the GUI approach appears incomplete if there are files that are required by the project but that are NOT included in the project.
For example, I have a linker script file that is included by the main linker script. If I add this secondary script file to the project the build fails. If I exclude it from the project then the template GUI does not include in in the template. Note that with VS2015 I do not see an option to “Exclude from build” only “Exclude from Project.”
The only way I find to work around this is to have the secondary file as a part of the project, do the template export, create a new project from the template and then remove the file from the project. It would be so nice if the export GUI presented an interface to add additional files.
SidNovember 17, 2017 at 05:44 #13008
No problem, we can help you get GUI to work – this is 100% supported.
VisualGDB will only include a file in the template if both of the following holds for it:
- The file resides inside the project directory (or one of its subdirectories)
- The file is explicitly included in the project in Solution Explorer
E.g. the following files won’t be included:
- Any sources outside the project directory (with relative paths starting with ..\)
- Linker scripts unless you explicitly add them to SolutionExplorer and copy under the project directory
- Any header files included from your sources, but not present in Solution Explorer or residing outside the project directory
Hope this helps. If not, please let us know which file you are trying to include, where is it located and how does it look in Solution Explorer (i.e. its item type and relative path).November 17, 2017 at 22:22 #13010
I thought I had explained this …
For example, I have a linker script file that is included by the main linker script. If I add this secondary script file to the project the build fails. If I exclude it from the project then the template GUI does not include in in the template
The file I have trouble with is a secondary linker script. It is located in the project folder. It CAN NOT be added to the project or the build system complains. This file is included by the primary linker script.
SidNovember 18, 2017 at 04:24 #13011
Please, please, please always provide more details about the errors you encounter. We would absolutely love to help you, but it is almost impossible to guess what is going on without knowing the exact error messages. VisualGDB build system is complex and it could be broken by incorrect settings in tens of different options, each one resulting in a different error message. Unfortunately we cannot provide much help without knowing the exact message shown by the build system.November 18, 2017 at 16:07 #13013
The secondary linker script is not found because it is not included in the custom template.
You must be logged in to reply to this topic.