Referenced projects in Web Application are generated strange so build fails

Add-in Express™ Support Service
That's what is more important than anything else

Referenced projects in Web Application are generated strange so build fails
 
Ralph Jansen




Posts: 9
Joined: 2013-07-10
I have in my solution 25 setup projects. Most of them are setups that places the output of a webapplication to a specific folder. I'm using the Add-in to generate a WIX setup.
This works on my machine but not on the build server.
The converted Product.wxs has all the files and dll's but the referenced project in the solution (say a simple class library) is placed in the Product.wxs as a relative path to the referenced project dll's. How to fix this because my build fails.
Posted 10 Jul, 2013 06:08:42 Top
Ralph Jansen




Posts: 9
Joined: 2013-07-10
Extra info:

I have a test project with a standard MVC 4 web application called WebApplicationWix.
I have a referenced class library called Entities.Test.

I created a standard Microsoft Setup project that get's the primary out and the content of the web application.
When I install that, the referenced class library is installed.
I convert that project to WIX and this works fine on my machine but not on the build server of TFS 2010 SP1.
The error is that he can't find the referenced projects.


<Component Id='com_DAB72D87_75FC_CEFE_4681_FF8FEF4887C8' Guid='D69091AC-C47E-4C2F-B06A-0B732281DA59' Permanent='no' SharedDllRefCount='no' Transitive='no'>
                    <File Id='_DAB72D87_75FC_CEFE_4681_FF8FEF4887C8' DiskId='1' Hidden='no' ReadOnly='no' System='no' Vital='yes' Compressed='yes' Name='Entities.Test.dll' Source='. .Entities.TestinDebugEntities.Test.dll' KeyPath='yes' />
                </Component>


I think that this has to do with the relative folder in the Source attribute. Can you help me?
Posted 10 Jul, 2013 06:14:16 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ralph,

Please try to add the 'Entities.Test.dll' file as a Primary Output to the vdproj setup. In this case the wix setup will use the Visual Studio variables to detect the location of the 'Entities.Test' project. Also you will need to exclude the 'Entities.Test.dll' file from the 'Detected Dependencies' section of the vdproj setup project.
Posted 10 Jul, 2013 08:09:29 Top
Ralph Jansen




Posts: 9
Joined: 2013-07-10
Hi Sergey,

Thanks! Your solution works for a part. I now get the following error on my build definition:

API restriction: The assembly 'file:///E:\Builds\Test_Rel_Wix\Binaries\_PublishedWebsites\WebApplicationWix\bin\Entities.Test.dll' has already loaded from a different location. It cannot be loaded from a new location within the same appdomain.

I did an exclude on the Entities.Test.dll in the "Detected Dependencies" folder in the solution explorer of the MS setup project. I then added the "primary output" in the "File System Editor" of the MS setup project. I did this in the bin folder otherwise the dll was placed in the root of the web application.

I also changed the solution configuration so that only the wix installer is build on the build server but without any luck.
The msi is generated and het Entities.Test.dll is placed in the bin folder. So that is not the problem. The build is now only partial succeeding because of the error.

Any suggestions?
Posted 11 Jul, 2013 00:58:39 Top
Ralph Jansen




Posts: 9
Joined: 2013-07-10
This was actually a simple solution. I saw the following http://bartwullems.blogspot.com/2012/05/tfs-build-assembly-has-already-loaded.html and saw that the build definition was searching for test assemblies.
I changed the assembly name to Entities.bla.dll and that fixed it.
Posted 11 Jul, 2013 01:25:13 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ralph,

Thank you for the helpful link. Let me know if you face any other difficulties.
Posted 11 Jul, 2013 06:29:52 Top
Ralph Jansen




Posts: 9
Joined: 2013-07-10
Well I had a problem with one project that the binaries of that project should be placed in the bin folder and the content should be placed in the install root directory. But this is more a WIX problem. I modified the project file to get this to work. Just added as name a number after it. So UserControls and UserControls_1.
Posted 11 Jul, 2013 07:33:09 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Yes, your trick will work.
Posted 11 Jul, 2013 09:55:17 Top
Ralph Jansen




Posts: 9
Joined: 2013-07-10
Hi Sergey,

I have one question left. I don't understand why my web.config transforms aren't fired for my web application. Is this possible with this add-in?
I found this tutorial but can't get it to work with the generated wix installer. Can you help me?

http://www.paraesthesia.com/archive/2010/07/30/how-to-consume-msdeploy-staged-web-site-output-in-a.aspx

An other option is to filter out the web.config but I don't know how to do that. Option 1 is better...

Thanks
Posted 12 Jul, 2013 04:24:26 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ralph,

The converter performs transformation for project outputs only. It uses HeatProject task instead of the 'HeatDirectory' one. Do you want to transform web.config via XSLT while the setup is built?
Posted 12 Jul, 2013 05:34:26 Top