You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have previously used EnvDTE to create projects, but found that it was unstable when I wanted to create more than one project at a time. I was trying to get it to work via the toolkit / IvsSolution, but I can't figure out the right combination of initializers and parameter.
For instance, i hoped that the below code would create a new C# class library, but I keep getting Package not loaded. I have no idea why. There is also a IvsProjectFactory, but not much documentation around on how to use it.
IVsSolution ivsSolution = await VS.Services.GetSolutionAsync();
Guid CSharpGuid = new Guid(ProjectTypes.CSHARP);
Guid Empty = Guid.Empty;
Guid Unknown = VSConstants.IID_IUnknown;
string template = DTEItemHelper.GetVsProjectTemplatePath("ClassLibrary");
int ret = ivsSolution.CreateProject(ref Empty, template, @"C:\Dev Data", "MyTestProjectLibrary", (uint)__VSCREATEPROJFLAGS.CPF_CLONEFILE, ref Unknown, out IntPtr _);
Functionality to create projects of a specific type would be really helpful :-)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have previously used EnvDTE to create projects, but found that it was unstable when I wanted to create more than one project at a time. I was trying to get it to work via the toolkit / IvsSolution, but I can't figure out the right combination of initializers and parameter.
For instance, i hoped that the below code would create a new C# class library, but I keep getting Package not loaded. I have no idea why. There is also a IvsProjectFactory, but not much documentation around on how to use it.
Functionality to create projects of a specific type would be really helpful :-)
Beta Was this translation helpful? Give feedback.
All reactions