Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Visual Studio Template - Unable to copy the file from the project template...

$
0
0
I am trying to create a new Visual Studio Template to use in conjunction with SharePoint.

I am getting a error that says VS cannot find a file.

Specifically the error is...

"Unable to copy the file 'elements.xml' from the project template to the project.  Cannot find file "C:\Documents and Settings\local\Local Settings\Temp\s32ezrml.3jg\Temp\12\TEMPLATE\FEATURES\SharePoint_Web_Part1\elements.xml"

I have modified both the .vstemplate and .csproj files as so...


.csproj
  <ItemGroup>
    <Compile Include="Code\$safeprojectname$.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="12\TEMPLATE\FEATURES\$safeprojectname$\$safeprojectname$.webpart" />
    <None Include="Key.snk" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="12\TEMPLATE\FEATURES\$safeprojectname$\elements.xml" />
    <Content Include="12\TEMPLATE\FEATURES\$safeprojectname$\feature.xml" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="12\TEMPLATE\CONTROLTEMPLATES\$safeprojectname$\" />
    <Folder Include="12\TEMPLATE\IMAGES\" />
    <Folder Include="12\TEMPLATE\LAYOUTS\" />
  </ItemGroup>


.vstemplate
<TemplateContent>
    <Project TargetFileName="$safeprojectname$.csproj" File="WebPartTemplate.csproj" ReplaceParameters="true">
      <Folder Name="12" TargetFolderName="12">
        <Folder Name="TEMPLATE" TargetFolderName="TEMPLATE">
          <Folder Name="CONTROLTEMPLATES" TargetFolderName="CONTROLTEMPLATES">
            <Folder Name="WebPartTemplate" TargetFolderName="$safeprojectname$" />
          </Folder>
          <Folder Name="FEATURES" TargetFolderName="FEATURES">
            <Folder Name="WebPartTemplate" TargetFolderName="$safeprojectname$">
              <ProjectItem ReplaceParameters="true" TargetFileName="elements.xml">elements.xml</ProjectItem>
              <ProjectItem ReplaceParameters="true" TargetFileName="feature.xml">feature.xml</ProjectItem>
              <ProjectItem ReplaceParameters="true" TargetFileName="$safeprojectname$.webpart">WebPartTemplate.webpart</ProjectItem>
            </Folder>
          </Folder>
          <Folder Name="IMAGES" TargetFolderName="IMAGES" />
          <Folder Name="LAYOUTS" TargetFolderName="LAYOUTS" />
        </Folder>
      </Folder>
      <Folder Name="Code" TargetFolderName="Code">
        <ProjectItem ReplaceParameters="true" TargetFileName="$safeprojectname$.cs">WebPartTemplate.cs</ProjectItem>
      </Folder>
      <Folder Name="Properties" TargetFolderName="Properties">
        <ProjectItem ReplaceParameters="true" TargetFileName="AssemblyInfo.cs">AssemblyInfo.cs</ProjectItem>
      </Folder>
    </Project>
  </TemplateContent>


Can anyone help with the reason why I am receiving this error?  Thanks in advance.

Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>