Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS2022 & VS2019 support #65

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

VS2022 & VS2019 support #65

wants to merge 19 commits into from

Conversation

hippasus
Copy link

Hi Oleg,

I've managed to make this excellent tool targeting to both Visaul Studio 2019 and Visual Studio 2022.

It is still using deprecated APIs, however, it works.

Hippasus.

@hippasus hippasus changed the title VS2020 & VS2019 support VS2022 & VS2019 support Nov 14, 2021
@hippasus
Copy link
Author

For anyone who want to use this tool, I'm uploading the built VSIX file here.
For Visual Studio 2019: T4Toolbox.16.0.0.0.vsix.zip
For Visual Studio 2022: T4Toolbox.17.0.0.0.vsix.zip

@islaytitans
Copy link

This works a treat, thanks @hippasus

@bn-obelu
Copy link

bn-obelu commented Aug 4, 2022

Thank you for great work!

It stopped working since VS 17.2.4 update.

Severity	Code	Description	Project	File	Line	Suppression State
Error		Running transformation: System.Runtime.Serialization.SerializationException: Type 'Microsoft.VisualStudio.CommonIDE.Solutions.Dte.DteProjects' in Assembly 'Microsoft.VisualStudio.CommonIDE, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable.

Server stack trace: 
   at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context)
   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo()
   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
   at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.SerializeMessageParts(ArrayList argsToSerialize)
   at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage..ctor(IMethodReturnMessage mrm)
   at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.SmuggleIfPossible(IMessage msg)
   at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm)
   at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at EnvDTE._Solution.get_Projects()
   at Microsoft.VisualStudio.TextTemplatingB5EC13400F541F31CD2FF70C4DE270BF66420DA4352A9431CD2EB6412E99ACEBEDB91B4DA7F9C256938CE1D4BEBE32F59E9FD89030A3D4D1ED0703898B13BE6D.GeneratedTextTransformation.IdeUtils.FindProject(DTE dte, String name) in C:\introniseng\qa\Automation.CodeGeneration\T4\IdeUtils.tt:line 16
   at Microsoft.VisualStudio.TextTemplatingB5EC13400F541F31CD2FF70C4DE270BF66420DA4352A9431CD2EB6412E99ACEBEDB91B4DA7F9C256938CE1D4BEBE32F59E9FD89030A3D4D1ED0703898B13BE6D.GeneratedTextTransformation.TransformText() in C:\introniseng\qa\Automation.Maestro\MaestroClassGenerator.tt:line 9	Miscellaneous Files	C:\introniseng\qa\Automation.CodeGeneration\T4\IdeUtils.tt	16	

@hippasus
Copy link
Author

hippasus commented Aug 5, 2022

it works on my computer, I'm using VS 17.2.5.

could you please show me your .tt file, are you using something like IServiceProvider.GetService ?

@bn-obelu
Copy link

bn-obelu commented Aug 8, 2022

Yes, I was using GetService, now it works with GetCOMService. One thing that I think is not working, if I update a template, the generator dosen't update the file with the changes, any ideea why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants