T4Toolbox
T4Toolbox copied to clipboard
Add support for VS 2019
Hi,
I updated source code of T4Toolbox to be possible use it with VS 2019.
I also think this should not be merged to current repository and instead of this should have its own repository.
I am also not for 100% sure if i changed all needed fields.
Thanks
#59
hi @peterM any complied vsix file link?
hi @hippasus, you just need clone my branch and build it. Then vsix
will be saved in bin
folder I can provide one but i am not sure if it is right way how to do it. I am new in open source
and I do not want to do something wrong way.
Thanks for this idea @peterM! I was able to clone, build, and install from the .VSIX as you mentioned. I only have two issues: 1) VS 2019 is complaining about this extension loading synchronously, and 2) I couldn't resolve the error "The service 'Microsoft.Internal.VisualStudio.Shell.Interop.SVsUIThreadInvokerPrivate' must be installed for this feature to work. Ensure that this service is available" when trying to run the tests. But for now, this appears to be a viable short-term solution.
Hi @3milio, Thank you for your input. I will try to look on issues. Maybe i will be able to solve them.
Could you more describe 2nd issue (steps to reproduce)? I did not experience it.
@peterM, sorry for the delay in responding. I simply chose (in VS 2019) to 'Run All' tests and got the error for just the integration tests. All other tests pass, or are skipped. And this is the error they get.
@3milio I will try. To be honest on my computer did not work tests .. but when i commited code and pull requests checks triggered build it was after several attempts green :) Also this could be connected with VSSDK. Did you install also VS Extensibility packages?
Last week I tried migrate extension to support Asynchronous loading, but is not so easy to change inheritance from Package
to AsyncPackage
.
I had extension file, but Visual studio started to be unstable and extension unreliable :/
BTW: Visual studio 2019.1 will probably stop support loading synchronous packages so it will need to implement AsyncPackage
instead of Package
new to this GitHub, how do I pull your branch?
new to this GitHub, how do I pull your branch?
execute git clone https://github.com/peterM/T4Toolbox.git
Any way this could get merged or a new repository added so others can access it via VS 2019? Thanks peterM for doing this! I just pulled down your version to run the install and it worked great, but would be nice not to have to do that.
What is the plan for official release for VS 2019?
Thanks for doing this @PeterM When I loaded the solution on a Win10 / VS2019 dev box, VS complained that it wanted .Net 3.5. I went ahead and it still wouldn't build.
Here's the build log:
1>------ Rebuild All started: Project: T4Toolbox, Configuration: Debug Any CPU ------
2>------ Rebuild All started: Project: T4Toolbox.VisualStudio.ItemTemplates, Configuration: Debug Any CPU ------
1> T4Toolbox -> C:\dev\src\spikes\T4Toolbox\src\T4Toolbox\bin\Debug\T4Toolbox.dll
3>------ Rebuild All started: Project: T4Toolbox.TemplateAnalysis, Configuration: Debug Any CPU ------
4>------ Rebuild All started: Project: T4Toolbox.DirectiveProcessors, Configuration: Debug Any CPU ------
5>------ Rebuild All started: Project: T4Toolbox.Tests, Configuration: Debug Any CPU ------
3>C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.TemplateAnalysis\TemplateScanner.partial.cs(39,30,39,37): error CS0115: 'TemplateScanner.yyerror(string, params object[])': no suitable method found to override
3>C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.TemplateAnalysis\TemplateScanner.partial.cs(61,47,61,55): error CS0246: The type or namespace name 'ScanBuff' could not be found (are you missing a using directive or an assembly reference?)
3>C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.TemplateAnalysis\TemplateScanner.partial.cs(79,33,79,36): error CS0115: 'TemplateScanner.TemplateBuffer.Pos': no suitable method found to override
3>C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.TemplateAnalysis\TemplateScanner.partial.cs(85,33,85,37): error CS0115: 'TemplateScanner.TemplateBuffer.Read()': no suitable method found to override
3>C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.TemplateAnalysis\TemplateScanner.partial.cs(108,36,108,45): error CS0115: 'TemplateScanner.TemplateBuffer.GetString(int, int)': no suitable method found to override
6>------ Rebuild All started: Project: T4Toolbox.VisualStudio.Editor, Configuration: Debug Any CPU ------
7>------ Rebuild All started: Project: T4Toolbox.TemplateAnalysis.Tests, Configuration: Debug Any CPU ------
6>CSC : error CS0006: Metadata file 'C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.TemplateAnalysis\bin\Debug\T4Toolbox.TemplateAnalysis.dll' could not be found
8>------ Rebuild All started: Project: T4Toolbox.VisualStudio.Editor.Tests, Configuration: Debug Any CPU ------
4> T4Toolbox.DirectiveProcessors -> C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.DirectiveProcessors\bin\Debug\T4Toolbox.DirectiveProcessors.dll
9>------ Rebuild All started: Project: T4Toolbox.VisualStudio, Configuration: Debug Any CPU ------
8>CSC : error CS0006: Metadata file 'C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.TemplateAnalysis\bin\Debug\T4Toolbox.TemplateAnalysis.dll' could not be found
8>CSC : error CS0006: Metadata file 'C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.VisualStudio.Editor\bin\Debug\T4Toolbox.VisualStudio.Editor.dll' could not be found
9>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2114,5): warning MSB3277: Found conflicts between different versions of "Microsoft.Build.Framework" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
9>CSC : error CS0006: Metadata file 'C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.TemplateAnalysis\bin\Debug\T4Toolbox.TemplateAnalysis.dll' could not be found
9>CSC : error CS0006: Metadata file 'C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.VisualStudio.Editor\bin\Debug\T4Toolbox.VisualStudio.Editor.dll' could not be found
10>------ Rebuild All started: Project: T4Toolbox.vsix, Configuration: Debug Any CPU ------
5> T4Toolbox.Tests -> C:\dev\src\spikes\T4Toolbox\test\T4Toolbox.Tests\bin\Debug\T4Toolbox.Tests.dll
11>------ Rebuild All started: Project: T4Toolbox.VisualStudio.Tests, Configuration: Debug Any CPU ------
10>CSC : error CS0006: Metadata file 'C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.TemplateAnalysis\bin\Debug\T4Toolbox.TemplateAnalysis.dll' could not be found
10>CSC : error CS0006: Metadata file 'C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.VisualStudio\bin\Debug\T4Toolbox.VisualStudio.dll' could not be found
10>CSC : error CS0006: Metadata file 'C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.VisualStudio.Editor\bin\Debug\T4Toolbox.VisualStudio.Editor.dll' could not be found
12>------ Rebuild All started: Project: T4Toolbox.VisualStudio.IntegrationTests, Configuration: Debug Any CPU ------
7>CSC : error CS0006: Metadata file 'C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.TemplateAnalysis\bin\Debug\T4Toolbox.TemplateAnalysis.dll' could not be found
12>CSC : error CS0006: Metadata file 'C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.VisualStudio\bin\Debug\T4Toolbox.VisualStudio.dll' could not be found
12>CSC : error CS0006: Metadata file 'C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.VisualStudio.Editor\bin\Debug\T4Toolbox.VisualStudio.Editor.dll' could not be found
11>CSC : error CS0006: Metadata file 'C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.TemplateAnalysis\bin\Debug\T4Toolbox.TemplateAnalysis.dll' could not be found
11>CSC : error CS0006: Metadata file 'C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.VisualStudio\bin\Debug\T4Toolbox.VisualStudio.dll' could not be found
11>CSC : error CS0006: Metadata file 'C:\dev\src\spikes\T4Toolbox\src\T4Toolbox.VisualStudio.Editor\bin\Debug\T4Toolbox.VisualStudio.Editor.dll' could not be found
========== Rebuild All: 4 succeeded, 8 failed, 0 skipped ==========
Here is built extension T4Toolbox.0.0.0.0.zip
What is the plan for official release for VS 2019?
Hmm is hard to say because i think original author do not have time to maintain this. Hopefuly someone will take it. Currently i also do not have time to properly migrate this extension to fully support VS2019
After installed T4Toolbox.0.0.0.0.zip in vs 2019 preview 16.4.0 there is some problem with include once="true" because "once" attribute is not recognized
Thanks @peterM this works for me - although I only use a limited set of features here (basically I use this primarily to trigger a rebuid of a .tt template when an xml file is changed)
I do notice however that it can only be loaded via allowing synchronous packages to load. Is this something that is simple to update?
Also maybe @olegsych could accept and make this official?
Thanks @peterM this works for me - although I only use a limited set of features here (basically I use this primarily to trigger a rebuid of a .tt template when an xml file is changed)
I do notice however that it can only be loaded via allowing synchronous packages to load. Is this something that is simple to update?
Also maybe @olegsych could accept and make this official?
I tried to migrate it to use AsyncPackage
what is new way how to integrate extensions into VS but it was not work and i do not have time to fix it.
I'm giving it a go based on PeterM's fork. The AsyncPackage is a bit of a bind. In a lot of places the ServiceLocator is passed down into the objects and stored. At a later point, in a synchronous method, it then tries to resolve a service.
Under the AsyncPackage you can't do this, because resolving services becomes an asynchronous process. (GetServiceAsync vs GetService)
So I'm refactoring the relevant objects to accept their dependencies through constructors. I'll do the service resolution asynchronously BEFORE object creation.
Once I've slain that dragon, I'll work out how to get the Visual Studio Integration tests working. MSTest v1 had some special sauce for running those which no longer exists in MSTest v2.
I tried to compile the projects but I have the following problem:
First a compilation error:
if (commandGroup == VSConstants.VSStd2K &&
VSConstants is not found and I find out that I have to install the package Microsoft.VisualStudio.Shell.Framework. But it seems one its dependencies is not compatible with .NET 4.72:
Install-Package : Could not install package 'Microsoft.ServiceHub.Analyzers 2.6.92'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.7.2', but the package does not contain any assembly references or content files that are compatible with that framework.
I was able to compile it and build the VSIX for Visual Studio 2019. Download it here: http://dl.compdj.us/download/index/T4Toolbox15003VS2019vsix
Install-Package : Could not install package 'Microsoft.ServiceHub.Analyzers 2.6.92'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.7.2', but the package does not contain any assembly references or content files that are compatible with that framework.
@dbalciunas Have you been able to resolve /work around this issue or found the cause? I'm seing something similar when trying to update nuget packages of another vsix project.
Thanks!
Install-Package : Could not install package 'Microsoft.ServiceHub.Analyzers 2.6.92'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.7.2', but the package does not contain any assembly references or content files that are compatible with that framework.
@dbalciunas Have you been able to resolve /work around this issue or found the cause? I'm seing something similar when trying to update nuget packages of another vsix project.
Thanks!
No, I don't. I didn't try anymore. Sorry.
No, I don't. I didn't try anymore. Sorry.
Do you think one should open a separate issue on this? Where would be the right place for that?
Why does this break with every release of Visual Studio? The T4Toolbox is such a great utility for what it does, this is really a pain.
Do we have a working build yet?