Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > <Compile Include> Strangeness....
 

<Compile Include> Strangeness....

Hi all,

I have some strange behaviour when creating a project using my GAT package. I have a project which site in the solutions\projects directory and the .proj files has a section like this:

<ItemGroup>

<Compile Include="*.wxs" />

<Compile Include="..\..\..\..\..\Common\WiX\Common.Web.wxs">

<Link>Common.Web.wxs</Link>

</Compile>

</ItemGroup>

which creates a link to a files in the project (the project is created in a standard location, so the relative path is OK). However, when I run the package and the project is created, the section magically changes to this:

<ItemGroup>

<Compile Include="*.wxs" />

<Compile Include="..\..\..\..\..\..\..\..\Documents and Settings\Common\WiX\Common.Web.wxs">

<Link>Common.Web.wxs</Link>

</Compile>

</ItemGroup>

I've no idea when it's got the Documents and Settings bit from, when I''ve created my project in the path: C:\Code\SETP_P2\Root\Src\Exchange\Enterprise Library\ExwebService1

Any ideas????

Alex Stevens  Thursday, March 01, 2007 12:39 PM
Hi Alex,

This is weird and I can think of anything that may be causing this from the top of my head...

Are you able to repro this behavior using a very simple package? If you could do so, I can ask my team to take a look at it and see if we can find out what's causing this...

thanks,
-Victor.
vga  Sunday, March 04, 2007 4:48 PM

Victor,

I created a brand new guidance package, and appended the following to the console application project within the sample solution:

<ItemGroup>

<Compile Include="*.wxs" />

<Compile Include="..\..\..\..\..\Common\WiX\Common.Web.wxs">

<Link>Common.Web.wxs</Link>

</Compile>

</ItemGroup>

When I ran the package and create the sample solution the project was created with the following (i've included some extra lines around it).

<ItemGroup>

<Compile Include="Properties\AssemblyInfo.cs" />

</ItemGroup>

<ItemGroup>

<Compile Include="*.wxs" />

<Compile Include="..\..\..\..\..\..\..\..\Documents and Settings\Common\WiX\Common.Web.wxs">

<Link>Common.Web.wxs</Link>

</Compile>

</ItemGroup>

I'm strapped for time today, but I'll try different filenames and see the effect on them tomorrow. Even when the path "..\..\..\..\..\Common\WiX\Common.Web.wxs"resolves to the file (the project is created in a directory which fits), it changes the include statement just the same.

Thanks

Alex Stevens  Monday, March 05, 2007 3:02 PM
Hi Alex / Ivan,

Could you finally work around this? If you couldn't please let me know and I'll try to take a look at it.

thanks,
-Victor.
vga  Wednesday, June 13, 2007 12:57 PM

Hi Monesh,

How does your folder structure looks like?

I'll ask our team to look at this.

thanks,

-Victor.

vga  Monday, June 25, 2007 11:13 AM

hello everyone

I solved this problem.

I called the action and in the action I used

projectItems.AddfromFile("d:\test\hr\version\projectversion.cs")

Thanks

Monesh  Monday, July 09, 2007 12:00 PM
Hi Alex,

This is weird and I can think of anything that may be causing this from the top of my head...

Are you able to repro this behavior using a very simple package? If you could do so, I can ask my team to take a look at it and see if we can find out what's causing this...

thanks,
-Victor.
vga  Sunday, March 04, 2007 4:48 PM

Thanks for the reply Victor, I will create a new package and see what behaviour that produces.

Further to this, I've built and installed my package on a collegue's computer and got different behaviour. The project markup looked like this after the package had run (it now has six sets of ..\ instead of the 5 in the proejct template):

<ItemGroup>

<Compile Include="*.wxs" />

<Compile Include="..\..\..\..\..\..\Common\WiX\Common.Web.wxs">

<Link>Common.Web.wxs</Link>

</Compile>

</ItemGroup>

More interestingly however, is the previous version (uninstalled) had 6 sets of ..\ ????

Will post findings later.

Alex Stevens  Monday, March 05, 2007 9:37 AM

Victor,

I created a brand new guidance package, and appended the following to the console application project within the sample solution:

<ItemGroup>

<Compile Include="*.wxs" />

<Compile Include="..\..\..\..\..\Common\WiX\Common.Web.wxs">

<Link>Common.Web.wxs</Link>

</Compile>

</ItemGroup>

When I ran the package and create the sample solution the project was created with the following (i've included some extra lines around it).

<ItemGroup>

<Compile Include="Properties\AssemblyInfo.cs" />

</ItemGroup>

<ItemGroup>

<Compile Include="*.wxs" />

<Compile Include="..\..\..\..\..\..\..\..\Documents and Settings\Common\WiX\Common.Web.wxs">

<Link>Common.Web.wxs</Link>

</Compile>

</ItemGroup>

I'm strapped for time today, but I'll try different filenames and see the effect on them tomorrow. Even when the path "..\..\..\..\..\Common\WiX\Common.Web.wxs"resolves to the file (the project is created in a directory which fits), it changes the include statement just the same.

Thanks

Alex Stevens  Monday, March 05, 2007 3:02 PM

Hi Alex,

Have you found a solution for this problem ? We are experiencing the same issue and we have not yet figured out what to do ....

Thanks

Ivan 4ward  Tuesday, March 20, 2007 9:50 AM
Hi Alex / Ivan,

Could you finally work around this? If you couldn't please let me know and I'll try to take a look at it.

thanks,
-Victor.
vga  Wednesday, June 13, 2007 12:57 PM

Hello everyone,

I am also facing this problem.

My csproj file of Business Project is

<Compile Include="..\..\..\..\..\Version\ProjectVersion.cs">
<Link>ProjectVersion.cs</Link>
</Compile>

It build and registered successfully.

when I run newly created Guidance Package,

It changes to

<Compile Include="C:\Documents and Settings\Version\ProjectVersion.cs">
<Link>ProjectVersion.cs</Link>
</Compile>

Even I hard-coded my required path in .csproj file,but it again give the same i.e

C:\Documents and Settings\Version\ProjectVersion.cs.

I hope you peopleget the solution of this

Thanks

Monesh  Monday, June 25, 2007 8:45 AM

Hi Monesh,

How does your folder structure looks like?

I'll ask our team to look at this.

thanks,

-Victor.

vga  Monday, June 25, 2007 11:13 AM

Thanks Victor ,

I have an embedded structures of folders.My solution.vstemplate file is as shown:

<TemplateContent>
<ProjectCollection>
<SolutionFolder Name="HR">
<SolutionFolder Name="Portal">
<SolutionFolder Name="Folder1">
<SolutionFolder Name="Folder2">
<SolutionFolder Name="$ProjectName$">
<ProjectTemplateLink ProjectName="Portal.$ProjectName$.Business">Projects\Portal.TEST.Business\MyTemplate.vstemplate</ProjectTemplateLink>

</ProjectTemplateLink >

</SolutionFolder>

</SolutionFolder>

</SolutionFolder>

</SolutionFolder>

</SolutionFolder>

</ProjectCollection>

</Templatecontent>

And Here in Business Project's .csproj file

<Compile Include="..\..\..\..\..\Version\ProjectVersion.cs">
<Link>ProjectVersion.cs</Link>
</Compile>

My Folder structure is as follow:

HR->Portal->Folder1->Folder2->TEST->Portal.TEST.Business

->Version->ProjectVersion.cs

Important:The Version folder and ProjectVersion.cs fileis added through custome action

Thanks

Monesh  Monday, June 25, 2007 12:05 PM

Hello victor

Really this is strange problem.I have 12 projects,that arelinks through my solution.vstemplate file

One of my.csproj file looks like

<Compile Include="..\Version\ProjectVersion.cs">
<Link>ProjectVersion.cs</Link>
</Compile>

when I run newly created Guidance Package,

It changes to

<Compile Include="C:\Documents and Settings\Administrator\Local Settings\Temp\lzlrnolq.v3w\Version\ProjectVersion.cs">
<Link>ProjectVersion.cs</Link>
</Compile>

in place of

C:\Documents and Settings\Version\ProjectVersion.cs(That I get at business Project)

Thanks

Monesh  Tuesday, June 26, 2007 6:43 AM

Hi Monesh,

Could you post the code snippet what you're using to add the ProjectVersion.cs item to your project? I think that there you've the issue.

jose.

Jose Escrich  Thursday, June 28, 2007 3:15 PM

hello jose,

Thanks for seeing my problem.

here is my action file which is used to create directory structure

IDictionaryService dictionary = (IDictionaryService)GetService(typeof(IDictionaryService));
String FrameworkLocation = (String)dictionary.GetValue("Framework") + "\\HR";
String SolutionLocation = (String)dictionary.GetValue("destinationdirectory") + "\\HR";
Directory.CreateDirectory(SolutionLocation + "\\Version");
File.Copy(FrameworkLocation + "\\Version\\ProjectVersion.cs", SolutionLocation + "\\Version\\ProjectVersion.cs");

Framework is my custom argument,

destinationdirectory give the location of newly created project

Above code works fine,and file projectversion.cs is copied at exact location that I want.

Thanks

Monesh  Monday, July 02, 2007 5:21 AM

Hi Monish,

I think that it is due to issue with <link> tag in GAT.

When GAT unfold your project,it is looking for link file, which is not the part of particular project, hence it is not copied with project template. Normally <link> tag is used where we want to use a file in multiple projects. So that file is not become a part of any project but link is used in each project.

Please remove <link> tag and try again. I hope your issue will resolved.

Thanks

Ajit

AjitShekhawat  Monday, July 02, 2007 11:05 AM

hello Ajit

Thanks for seeing this problem.

I already try this but this not work

Victor/jose have u find the solution for this

Guide me

Thanks

Monesh  Tuesday, July 03, 2007 4:21 AM

hello everyone

I solved this problem.

I called the action and in the action I used

projectItems.AddfromFile("d:\test\hr\version\projectversion.cs")

Thanks

Monesh  Monday, July 09, 2007 12:00 PM

You can use google to search for other answers

Custom Search

More Threads

• CreateProjectAction doesn't replace parameters regardless of ReplaceParameters value in vstemplate
• Parse referenced assemblies
• Preselecting wizard items
• Error trying to install or uninstall GAX
• Pull project from sourcesafe on unfold
• Access Denied error on Install of Feb GAT
• Not showing Added Item Template in Add New DailogBox
• Item has already been added. Key in dictionary:
• How to include required softwares in deployment process
• Unfoldtemplate getting information out of the RunStarted methode "replacementsDictionary"