CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > visual_studio.vs_2005_web_application_projects Tags:
Item Type: Date Entered: 11/9/2006 1:13:15 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 8 Views: 79 Favorited: 0 Favorite
9 Items, 1 Pages 1 |< << Go >> >|
"random user na
NewsGroup User
MSBuild integraction issue when publishing satellite assemblies11/9/2006 1:13:15 PM

0

Hello,

I believe, this is a bug report for Web Application Projects MS Build integration.

I am using Web Application Projects and MS Build. My Website project references another assembly, which has a bunch of culture specific satellite assemblies.

When I build a website using Visual Studio or its "Publish website" feature, the website's bin directory contains all the satellite assemblies in their respective subfolders:

bin\[de]\ReferencedAssembly.resources.dll
bin\[lt]\ReferencedAssembly.resources.dll
bin\[sv]\ReferencedAssembly.resources.dll
... etc.

However, then I build a website using MSBuild, the bin directory of the website (in _PublishedWebsites folder) does not have these satellite assemblies anymore.

While examining Web Application Projects "Microsoft.WebApplication.targets" file, I came to conclusion, that the problem lies in one of "_CopyWebApplication" target's copy tasks:

<!-- copy any referenced assemblies to _PublishedWebsites\app\bin folder -->
<Copy SourceFiles="@(ReferenceCopyLocalPaths)" DestinationFolder="$(WebProjectOutputDir)\bin" SkipUnchangedFiles="true" />

This copy task copies all the satellite assemblies from their language specific subfolders to one single file (!) in the bin folder of website. Which results in loss of all the culture specific assemblies, except for the last one in copy task. I can clearly see that in build log:

                <..skipped copying other referenced assemblies..>
                Copying file from "XXX\de\ReferencedAssembly.resources.dll" to "XXX\_PublishedWebsites\Website\bin\ReferencedAssembly.resources.dll".
                Copying file from "XXX\lt\ReferencedAssembly.resources.dll" to "XXX\_PublishedWebsites\Website\bin\ReferencedAssembly.resources.dll".
                Copying file from "XXX\sv\ReferencedAssembly.resources.dll" to "XXX\_PublishedWebsites\Website\bin\ReferencedAssembly.resources.dll".
                <..skipped..>

 

Is there any way to fix the "_CopyWebApplication" target in "Microsoft.WebApplication.targets" file, so that culture specific assemblies would be copied correctly?

Any other solutions possible?

Thank You,

 G.V.

 

 

 

 

"BradleyB" <>
NewsGroup User
Re: MSBuild integraction issue when publishing satellite assemblies11/16/2006 6:39:23 PM

0

You can fix this problem by modifying "Microsoft.WebApplication.targets" changing the Copy SourceFiles action for IntermediateSatelliteAssembliesWithTargetPath.

Before: 
<Copy SourceFiles="@(IntermediateSatelliteAssembliesWithTargetPath)" DestinationFolder="$(WebProjectOutputDir)\bin" SkipUnchangedFiles="true" />

After: 
<Copy SourceFiles="@(IntermediateSatelliteAssembliesWithTargetPath)" DestinationFiles="@(IntermediateSatelliteAssembliesWithTargetPath->'$(WebProjectOutputDir)\bin\%(Culture)\$(TargetName).resources.dll')" SkipUnchangedFiles="true" />

Hope this helps,
Brad.

"random user na
NewsGroup User
Re: MSBuild integraction issue when publishing satellite assemblies11/17/2006 1:43:09 PM

0

Thank you for the response.

I have tried changing the Copy SourceFile action for IntermediateSatelliteAssembliesWithTargetPath, but it did not help. As I've mentioned in my first post, the resource assemblies are not coppied in this action. They are copied in the action a few lines below:

<!-- copy any referenced assemblies to _PublishedWebsites\app\bin folder -->
<Copy SourceFiles="@(ReferenceCopyLocalPaths)" DestinationFolder="$(WebProjectOutputDir)\bin" SkipUnchangedFiles="true" />

Which is unexpected, but I have verified this behaviour by printing out messages before and after each copy action in  "Microsoft.WebApplication.targets".

Maybe this happens, because of our solution configuration (which is pretty basic)? As I wrote in my first post, the website itself does not have culture specific satellite assemblies, but it references another project, which contains all the culture specific satellite assemblies. However, publishing the site through Visual Studio works fine.

Any other ideas?

Thank you,

 Gundas Vilkelis

 

 

 


 

"BradleyB" <>
NewsGroup User
Re: MSBuild integraction issue when publishing satellite assemblies11/17/2006 7:44:54 PM

0

Got it.  The change I gave you before was for localized resources in the WAP project.  For referenced projects you'll need.

    <Copy SourceFiles="@(ReferenceCopyLocalPaths)" DestinationFiles="@(ReferenceCopyLocalPaths->'$(WebProjectOutputDir)\bin\%(DestinationSubDirectory)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />

 So the "Microsoft.WebApplication.targets" file should have both changes to be correct.

    <Copy SourceFiles="@(IntermediateSatelliteAssembliesWithTargetPath)" DestinationFiles="@(IntermediateSatelliteAssembliesWithTargetPath->'$(WebProjectOutputDir)\bin\%(Culture)\$(TargetName).resources.dll')" SkipUnchangedFiles="true" />
    <Copy SourceFiles="@(ReferenceCopyLocalPaths)" DestinationFiles="@(ReferenceCopyLocalPaths->'$(WebProjectOutputDir)\bin\%(DestinationSubDirectory)%(Filename)%(Extension)')" SkipUnchangedFiles="true" /> 

Hope this helps, Brad.

 

"random user na
NewsGroup User
Re: MSBuild integraction issue when publishing satellite assemblies11/20/2006 9:51:34 AM

0

Hi Brad,

These changes have fixed our problem. Thank you!

Regards,

Gundas Vilkelis

 

"jcnovoa" <>
NewsGroup User
Re: MSBuild integraction issue when publishing satellite assemblies1/16/2007 3:13:34 PM

0

Looking for best practices dealing with publishing Web Application type projects
and dependencies using MSBuild. So far I gather NOT to use the Web Deployment
Projects for this task, as is incompatible with Web Applications that have
nested Web Application in the file structure. I see that the IDE has the
capability to "Publish" a web application to an identified location
and determine what aspects of the Web Application to publish (or not i.e. source
code files). Regretfully the process via the "Publish" wizard is not
save anywhere in the solution. There is a *.Publish.xml which contains the history of the publish, 
there is additional info on the .user file, but I am still unsure on how to execute the _CopyWebApplication target from the WebApplication target schema,
and I was thinking there should be a way to go through the publish wizard, and instead of executing it would allow you to save the wizard output to a MSBuild xml type project for automated execution later on (similar to the way DTS packages use to work in SQL 2000)... I hope there is a way to do this without resorting to copying the whole folder where the app was created, and compiled, and then removing the source files etc...
"jcnovoa" <>
NewsGroup User
Re: MSBuild integraction issue when publishing satellite assemblies1/16/2007 4:37:34 PM

0

Ok... I figured out that the .Net Web Application Projects by default do not have a <OutDir>C:\DeployPath</OutDir> property, and that the WebApplication default targets include a target called "_CopyWebApplication" regretfully since the .Net WAP Project lacks this property, if you do not pass it to the msbuild command, it will fail to output the files to the "_PublishedWebsites" folder to be created under "C:\DeployPath" once I figured that out, I was able to compile the .CSProj/.VBProj with msbuild like so:

msbuild WAP.vbproj /target:_CopyWebApplication /property:OutDir=C:\DeployPath

I think the OutDir should've been part of the WAP projects from the get go, considering thers are web application type projects.... 

"jcnovoa" <>
NewsGroup User
Re: MSBuild integraction issue when publishing satellite assemblies1/21/2007 9:02:58 PM

0

None of these seemed to work for me to get referenced assemblies into the _Compiled folder when using _CopyWebApplication target to copy only the required files to the _Compiled folder of my choice. I resorted to using the Copy task from MSBuild, but considering thet the folder structure of the files I needed to copy did not allow me to use the built in recursive target, I ended-up having to split the "FROM" and the "TO" folders into manageble chunks. For example in a folder structure like the one below

-wwwroot 

-WebApplication

-SQLConnectionCode

-bin/*.dls

-WAP_1

-bin/*.dlls (including reference to SQLConnectionCode dlls and WAP_1Controls dlls below)

-WAP_1Controls

-bin/*.dlls

-WAP_2

-bin/*.dlls (including reference to SQLConnectionCode dlls and WAP_2Controls dlls below)

-WAP_2Controls

-bin/*.dlls

I do not want to copy the folder structure underneath SQLConnectionCode, so If I use a recursive target to copy the web application like so: "C:\InetPub\WWWRoot\WepApplication\**\bin\*.*" to opy files to "C:\InetPub\WWWRoot\WepApplicationDeployment\**\bin\" the SQLConnectionCode will also be copied. Instead,  I had to create separate ItemGroups for each of the WAPs I wanted to. Like so:

<

ItemGroup>

<

WAPReferencesFrom1 Include="C:\Inetpub\wwwroot\WebApplication\WAP1\bin\*.dll;C:\Inetpub\wwwroot\WebApplication\WAP1\bin\*.xml;C:\Inetpub\wwwroot\WebApplication\WAP1\bin\*.pdb" />

</

ItemGroup>

<

ItemGroup>

<

WAPReferencesFrom2 Include="C:\Inetpub\wwwroot\WebApplication\WAP1\Controls\bin\*.dll;C:\Inetpub\wwwroot\WebApplication\WAP1\Controls\bin\*.xml;C:\Inetpub\wwwroot\WebApplication\WAP1\Controls\bin\*.pdb" />

</

ItemGroup>

<ItemGroup>

<WAPReferencesFrom3 Include="C:\Inetpub\wwwroot\WebApplication\WAP2\bin\*.dll;C:\Inetpub\wwwroot\WebApplication\WAP2\bin\*.xml;C:\Inetpub\wwwroot\WebApplication\WAP2\bin\*.pdb" />

</ItemGroup>

<ItemGroup>

<WAPReferencesFrom4 Include="C:\Inetpub\wwwroot\WebApplication\WAP2\Controls\bin\*.dll;C:\Inetpub\wwwroot\WebApplication\WAP2\Controls\bin\*.xml;C:\Inetpub\wwwroot\WebApplication\WAP2\Controls\bin\*.pdb" />

</ItemGroup>

<ItemGroup>

<WAPReferencesTo1 Include="C:\Inetpub\wwwroot\WebApplication\WAP1\bin" />

</ItemGroup>

<ItemGroup>

<WAPReferencesTo2 Include="C:\Inetpub\wwwroot\WebApplication\WAP1\Controls\bin" />

</ItemGroup>

<ItemGroup>

<WAPReferencesTo3 Include="C:\Inetpub\wwwroot\WebApplication\WAP2\bin" />

</ItemGroup>

<ItemGroup>

<WAPReferencesTo4 Include="C:\Inetpub\wwwroot\WebApplication\WAP2\Controls\bin" />

</ItemGroup>

 

and then called these ItemGroups from my post-build process:

<

Copy SourceFiles="@(WAPReferencesFrom1)" DestinationFolder="@(WAPReferencesTo1)" />

<

Copy SourceFiles="@(WAPReferencesFrom2)" DestinationFolder="@(WAPReferencesTo2)" />

<

Copy SourceFiles="@(WAPReferencesFrom3)" DestinationFolder="@(WAPReferencesTo3)" />

<Copy SourceFiles="@(eHubReferencesFrom4)" DestinationFolder="@(eHubReferencesTo4)" />

<

Copy SourceFiles="@(eHubReferencesFrom5)" DestinationFolder="@(eHubReferencesTo5)" />

<

Copy SourceFiles="@(eHubReferencesFrom6)" DestinationFolder="@(eHubReferencesTo6)" />

<

Copy SourceFiles="@(eHubReferencesFrom7)" DestinationFolder="@(eHubReferencesTo7)" />

<

Copy SourceFiles="@(eHubReferencesFrom8)" DestinationFolder="@(eHubReferencesTo8)" />

<

Copy SourceFiles="@(eHubReferencesFrom9)" DestinationFolder="@(eHubReferencesTo9)" />

By using

<

MSBuild Properties="OutDir=C:\Inetpub\wwwroot\WAPCompiled\" Targets="_CopyWebApplication" Projects="@(WAPRootDeploy)" StopOnFirstFailure="true">

and the Copy tasks above, the build gave me exactly the files in the bin folder of all my deployed web applications as if I deployed them by the IDE Publish wizard

"jcnovoa" <>
NewsGroup User
Re: MSBuild integraction issue when publishing satellite assemblies1/21/2007 9:06:15 PM

0

None of these seemed to work for me to get referenced assemblies into the _Compiled folder when using _CopyWebApplication target to copy only the required files to the _Compiled folder of my choice. I resorted to using the Copy task from MSBuild, but considering thet the folder structure of the files I needed to copy did not allow me to use the built in recursive target, I ended-up having to split the "FROM" and the "TO" folders into manageble chunks. For example in a folder structure like the one below

-wwwroot 

-WebApplication

-SQLConnectionCode

-bin/*.dls

-WAP_1

-bin/*.dlls (including reference to SQLConnectionCode dlls and WAP_1Controls dlls below)

-WAP_1Controls

-bin/*.dlls

-WAP_2

-bin/*.dlls (including reference to SQLConnectionCode dlls and WAP_2Controls dlls below)

-WAP_2Controls

-bin/*.dlls

I do not want to copy the folder structure underneath SQLConnectionCode, so If I use a recursive target to copy the web application like so: "C:\InetPub\WWWRoot\WepApplication\**\bin\*.*" to opy files to "C:\InetPub\WWWRoot\WepApplicationDeployment\**\bin\" the SQLConnectionCode will also be copied. Instead,  I had to create separate ItemGroups for each of the WAPs I wanted to. Like so:

<

ItemGroup>

<

WAPReferencesFrom1 Include="C:\Inetpub\wwwroot\WebApplication\WAP1\bin\*.dll;C:\Inetpub\wwwroot\WebApplication\WAP1\bin\*.xml;C:\Inetpub\wwwroot\WebApplication\WAP1\bin\*.pdb" />

</

ItemGroup>

<

ItemGroup>

<

WAPReferencesFrom2 Include="C:\Inetpub\wwwroot\WebApplication\WAP1\Controls\bin\*.dll;C:\Inetpub\wwwroot\WebApplication\WAP1\Controls\bin\*.xml;C:\Inetpub\wwwroot\WebApplication\WAP1\Controls\bin\*.pdb" />

</

ItemGroup>

<ItemGroup>

<WAPReferencesFrom3 Include="C:\Inetpub\wwwroot\WebApplication\WAP2\bin\*.dll;C:\Inetpub\wwwroot\WebApplication\WAP2\bin\*.xml;C:\Inetpub\wwwroot\WebApplication\WAP2\bin\*.pdb" />

</ItemGroup>

<ItemGroup>

<WAPReferencesFrom4 Include="C:\Inetpub\wwwroot\WebApplication\WAP2\Controls\bin\*.dll;C:\Inetpub\wwwroot\WebApplication\WAP2\Controls\bin\*.xml;C:\Inetpub\wwwroot\WebApplication\WAP2\Controls\bin\*.pdb" />

</ItemGroup>

<ItemGroup>

<WAPReferencesTo1 Include="C:\Inetpub\wwwroot\WebApplication\WAP1\bin" />

</ItemGroup>

<ItemGroup>

<WAPReferencesTo2 Include="C:\Inetpub\wwwroot\WebApplication\WAP1\Controls\bin" />

</ItemGroup>

<ItemGroup>

<WAPReferencesTo3 Include="C:\Inetpub\wwwroot\WebApplication\WAP2\bin" />

</ItemGroup>

<ItemGroup>

<WAPReferencesTo4 Include="C:\Inetpub\wwwroot\WebApplication\WAP2\Controls\bin" />

</ItemGroup>

 

and then called these ItemGroups from my post-build process:

<

Copy SourceFiles="@(WAPReferencesFrom1)" DestinationFolder="@(WAPReferencesTo1)" />

<

Copy SourceFiles="@(WAPReferencesFrom2)" DestinationFolder="@(WAPReferencesTo2)" />

<

Copy SourceFiles="@(WAPReferencesFrom3)" DestinationFolder="@(WAPReferencesTo3)" />

<Copy SourceFiles="@(WAPReferencesFrom4)" DestinationFolder="@(WAPReferencesTo4)" />

By using

<

MSBuild Properties="OutDir=C:\Inetpub\wwwroot\WAPCompiled\" Targets="_CopyWebApplication" Projects="@(WAPRootDeploy)" StopOnFirstFailure="true">

Where  @(WAPRootDeploy) is a list of the .vpproj/.csproj that make up my deployable solution (minus the referenced projects like th SQLConnection above)

and the Copy tasks above, the build gave me exactly the files in the bin folder of all my deployed web applications as if I deployed them by the IDE Publish wizard

9 Items, 1 Pages 1 |< << Go >> >|


Free Download:













the following module was built either with optimizations enabled or without debug information

migrating web site --> web application

using iis instead of the asp.net development server

accesssing controls in code behind

remote debugging sometimes opens files from other projects

upgrade to release build gives "the project type is not supported by this installation"

download to excel file (diferent date format in different pcs)

intellisense not working for registered controls

wap not correctly wiring pages to classes?

looking for info on crystal reports

namespace for classes in app_code

after conversion, how do i fix html errors in wap the easy way?

how to create web project in remote iis with visual studio.net 2005

asp.net web site || asp.net web project

problem with profilecommon

problems with file upload

still problems with relative image paths

web application projects add-in for german version of vs 2005

problems with upgrading

web site administration tool

generation of designer file failed: unknown server tag 'prefix:controlname' (have sp1)

vs version compatibility confusion

problems getting webprofile to work with custom profile

how to use three tier architecture in a web project

assembly reference errors and general instability

data sources pane greyed out

using business objects as data source for ms report rdlcs with waps

mobile application

assembly problem

newbie help with structuring web application project

vs 2005 web application projects download

can't access a file

vs80-kb915364-x86-enu.exe installtion problem

how to store a usercontrol's position

problem with ifilter during pdf 2 text conversion

element 'element name here' is not a known element. this can occur if there is a compilation error in the web

asp.net 2 project suddently quit working

designer being oddly generated...

rc1 message "the character encoding for .csproj has changed"

relating file types in the solution explorer

integrate/combine web application projects with web site project

firing an event in page load

export to excel problem when i am giving ipaddress to url but it is working correct when running simple by writing localhost

where has "use master page" checkbox gone?

how do i mix vb and c# based pages in the new vs2005 web application project

weird build errors

wap, publish, msbuild

using wap = loosing performance ?

web combo row height is changing dynamically

getting error while running the application from server

   
  Privacy | Contact Us
All Times Are GMT