1

I've created a custom MVC VS project template for my company. Within the csproj file, I reference the "_references.js" file of a different project a couple of levels higher than my current project. The way I have added this file in the template is as follows:

<ItemGroup>
   <Content Include="..\..\MyCompany\Scripts\_references.js">      
     <Link>Scripts\_references.js</Link>
   </Content>
   ...
</ItemGroup>

However, this ends up rendering like this when the project is created:

<ItemGroup>
   <Content Include="..\..\..\..\..\..\..\Users\MyUser\AppData\Local\Temp\MyCompany\Scripts\_references.js">
     <Link>Scripts\_references.js</Link>
  </Content>
   ...
</ItemGroup>

It looks like the process of creating the project is resolving the path in relation to the location of where the template is being used to build the project.

Is there someway to force my path? I'd like this path to remain constant when the project is rendered.

Thanks!

Rockdocta
  • 604
  • 1
  • 9
  • 26
  • possible duplicate of [How do I create a Visual Studio project template that includes linked files?](http://stackoverflow.com/questions/6128488/how-do-i-create-a-visual-studio-project-template-that-includes-linked-files) – Iain Galloway Oct 28 '13 at 11:06
  • I ended up implementing a solution on my own that involves modifying the project file in the RunFinished methods of my project wizard. I will try changing it to what you found to see if that works for me. – Rockdocta Oct 29 '13 at 14:17

1 Answers1

1

As per the linked duplicate, there's a "CreateInPlace" property you can set which performs parameter replacement in-place rather than in a temporary location.

Community
  • 1
  • 1
Iain Galloway
  • 18,669
  • 6
  • 52
  • 73
  • I ended up coming back to this to insert another relative path in my project and implemented it this way..works perfectly. Thanks! – Rockdocta Dec 17 '13 at 19:13