Note that there are some explanatory texts on larger screens.

plurals
  1. POVisual Studio 2012/2013 crashes when creating a new custom project type or when closing
    primarykey
    data
    text
    <p>I am trying to create a custom language service for Visual Studio 2012/2013 (there doesn't seem to be much of a difference between these two). The custom language service is for a compiler that has yet not been integrated into Visual Studio. I started by creating a Visual Studio package for my custom project type. It all works fine, but when I create a new project in Visual Studio it crashes. Sometimes it only crashes when I close Visual Studio. I always get a COMException with no other hint to the problem. I think there is nothing wrong with my Visual Studio package but rather with my custom project file. It builds fine when I use MSBUILD but Visual Studio doesn't like it for some reason. I heard there are other people who had the same problem and it always had something to do with the custom project file. Unfortunately there is very little documentation on that topic.</p> <p>I am using the <code>ProjectPackage</code> of MPF to implement my package:</p> <pre><code>[ProvideProjectFactory(typeof(MyProjectFactory), null, "My Project Files (*.myproj);*.myproj", "myproj", "myproj", @"Templates\Projects", LanguageVsTemplate = "My Project")] [PackageRegistration(UseManagedResourcesOnly = true)] [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] [Guid(GuidList.ProjectPackageGuidString)] public sealed class MyProjectPackage : ProjectPackage { public MyProjectPackage() { Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString())); } protected override void Initialize() { base.Initialize(); this.RegisterProjectFactory(new MyProjectFactory(this)); } public override string ProductUserContext { get { return string.Empty; } } } </code></pre> <p>This is what my project factory looks like:</p> <pre><code>[Guid(GuidList.ProjectFactoryGuidString)] public class MyProjectFactory : ProjectFactory { public MyProjectFactory(Package package) : base(package) { this.package = package; } private Package package; protected override ProjectNode CreateProject() { MyProjectNode project = new MyProjectNode(this.package); project.SetSite((IOleServiceProvider)((IServiceProvider)this.package).GetService(typeof(IOleServiceProvider))); return project; } } </code></pre> <p>And this is my custom project node:</p> <pre><code>public class MyProjectNode : ProjectNode { public MyProjectNode(Package package) { this.package = package; } private Package package; public override Guid ProjectGuid { get { return new Guid(GuidList.ProjectFactoryGuidString); } } public override string ProjectType { get { return "My Project"; } } public override void AddFileFromTemplate(string source, string target) { this.FileTemplateProcessor.AddReplace("$Title$", Path.GetFileNameWithoutExtension(target)); this.FileTemplateProcessor.UntokenFile(source, target); this.FileTemplateProcessor.Reset(); } } </code></pre> <p>And this is my custom project file. I stripped it down to the bare minimum in order to locate the problem, but that didn't help:</p> <pre><code>&lt;Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt; &lt;PropertyGroup&gt; &lt;SchemaVersion&gt;2.0&lt;/SchemaVersion&gt; &lt;ProjectGuid&gt;454501B3-90E2-4735-ABDF-27B77BEBFD7A&lt;/ProjectGuid&gt; &lt;/PropertyGroup&gt; &lt;ItemGroup&gt; &lt;Compile Include="Program.my" /&gt; &lt;/ItemGroup&gt; &lt;Target Name="Build"&gt; &lt;Message Text="Hello, World!" /&gt; &lt;/Target&gt; &lt;/Project&gt; </code></pre> <p>Does anybody have experience with this? I looked at the source code of the IronPython and IronRuby Visual Studio integration, but that is much too complex.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload