Visual Studio Templates - public key not trusted

Visual Studio Templates - public key not trusted

Old forum URL: forums.lhotka.net/forums/t/5755.aspx


Jack posted on Thursday, November 06, 2008

I went through all the steps to add the c# templates to VS2008 but I am only able to access a few of them.  It seems some of them are signed and others are not.

EditableRoot.vstemplate

<VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
  <TemplateData>
    <DefaultName>EditableRoot.cs</DefaultName>
    <Name>EditableRoot</Name>
    <Description>CSLA.NET EditableRoot Class Template</Description>
    <ProjectType>CSharp</ProjectType>
    <SortOrder>10</SortOrder>
    <Icon>csla.ico</Icon>
  </TemplateData>
  <TemplateContent>
    <References>
      <Reference>
        <Assembly>Csla</Assembly>
      </Reference>
      <Reference>
        <Assembly>System</Assembly>
      </Reference>
      <Reference>
        <Assembly>System.Core</Assembly>
      </Reference>
      <Reference>
        <Assembly>mscorlib</Assembly>
      </Reference>
    </References>
    <ProjectItem SubType="Code" TargetFileName="$fileinputname$.cs" ReplaceParameters="true">EditableRoot.cs</ProjectItem>
  </TemplateContent>
</VSTemplate>

vs. EditableRootList:

<VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
  <TemplateData>
    <DefaultName>EditableRootList.cs</DefaultName>
    <Name>EditableRootList</Name>
    <Description>CSLA.NET EditableRootList Class Template</Description>
    <ProjectType>CSharp</ProjectType>
    <SortOrder>10</SortOrder>
    <Icon>csla.ico</Icon>
  </TemplateData>
  <TemplateContent>
    <References>
      <Reference>
        <Assembly>Csla</Assembly>
      </Reference>
      <Reference>
        <Assembly>System</Assembly>
      </Reference>
      <Reference>
        <Assembly>System.Core</Assembly>
      </Reference>
      <Reference>
        <Assembly>mscorlib</Assembly>
      </Reference>
    </References>
    <ProjectItem SubType="Code" TargetFileName="$fileinputname$.cs" ReplaceParameters="true">EditableRootList.cs</ProjectItem>
  </TemplateContent>
  <WizardExtension>
    <Assembly>CslaItemTemplateWizards, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=93be5fdc093e4c30</Assembly>
    <FullClassName>CslaItemTemplateWizards.ListWizard</FullClassName>
  </WizardExtension>

</VSTemplate>

Is this by design?  How does one go about either ignoring the key issues or making the key trusted.  The error I get in VS is:

Error: this template attempted to load an untrusted component 'CslaItemTemplateWizards, Version 1.0.0.0, Culture=neutral, PublicKeyToken=93be5fdc093e4c30.  For more information on this problem and how to enable this template, please see the documentation on Customizing Project Templates.

Any help is appreciated.

Thanks

jack

RockfordLhotka replied on Thursday, November 06, 2008

Nermin can give you a more complete answer.

But as I understand it, to avoid that dialog I'd have to purchase (annually) a real certificate from RapidSSL or someone. Since I give this code away for free, it seems unwise to incur a recurring expense just to avoid a dialog, so I suspect we'll just live with the dialog.

Jack replied on Thursday, November 06, 2008

The dialog I'm refering to kills the Add New Item process.  You cannot create the new item. 

I could certainly live with a warning message (which there is when your first import all the templates).

I think I have to go in and remove that extra Wizard section from the .vstemplate file.

  <WizardExtension>
    <Assembly>CslaItemTemplateWizards, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=93be5fdc093e4c30</Assembly>
    <FullClassName>CslaItemTemplateWizards.ParentListWizard</FullClassName>
  </WizardExtension>

RockfordLhotka replied on Thursday, November 06, 2008

I’ll let Nermin answer – this is totally in his ballpark.

 

I do know that the whole template/installer thing is a work in progress, so if there are issues that shouldn’t be entirely surprising. I also know he’s working on other tasks for his day job, and so this may or may not be done by the time 3.6 ships – but I’m sure it’ll be done at some point.

 

Rocky

 

 

From: Jack [mailto:cslanet@lhotka.net]
Sent: Thursday, November 06, 2008 4:58 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] Visual Studio Templates - public key not trusted

 

The dialog I'm refering to kills the Add New Item process.  You cannot create the new item. 

I could certainly live with a warning message (which there is when your first import all the templates).

I think I have to go in and remove that extra Wizard section from the .vstemplate file.



Chattererman replied on Thursday, November 20, 2008

There's no need to remove the <WizardExtension> section from the .vstemplate file.

You simply need to build CslaItemTemplateWizards.dll and copy it into <Visual Studio installation path>\Microsoft Visual Studio 9.0\Common7\IDE


mr_fuku replied on Thursday, February 26, 2009

Hi:

I've copied the dll as you suggested and still get the error message whenever trying to add an EditableChildList. The error message is:

Error: this template attempted to load an untrusted component 'CslaItemTemplateWizards, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=93be5fdc093e4c30'.'

Bummer.

This really doesn't bode well for the POC I'm trying to write if I can't even add classes based on  the templates.

-Ted

mr_fuku replied on Thursday, February 26, 2009

er - ok - after actually rebuilding the CslaItemTemplateWizards.dll as suggested by the previous post, the templates work.

in other words, you simply can't copy the existing dll. duh.

russelle replied on Friday, July 24, 2009

I've tried these fixes and none are working for me. Anybody have a step-by-step procedure for fixing the problem or working around it?

abiramipattar replied on Tuesday, July 28, 2009

Hi,

  I did all the above things & restarted Visual Studio and it started working. Hope this helps. Thanks.


Copyright (c) Marimer LLC