Question

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!

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top