2

I am trying to find out what is the alternative to using the Web Deployment projects in VS2011 as they do not seem to be supported anymore.

We have a number of projects where we are using them to share .ascx components among different projects. What is the recommended way to do that now?

Robert Ivanc
  • 1,402
  • 17
  • 32

2 Answers2

2

We have not yet finalized our plans for Web Deployment Projects for VS 11. We will be working on finalizing those plans in the coming week. If you have a specific scenario that you are trying to unblock I can try and help you. Feel free to send me an email at sayedha {at}[microsoft{dotcom}.

Sayed Ibrahim Hashimi
  • 43,864
  • 17
  • 144
  • 178
  • 1
    Always great to see vendors here answering questions. Thanks – NotMe May 11 '12 at 21:11
  • We are also using Web Deployment Project in similar scenarios (compiling all of the ASP/ASCX files into single assembly and then sharing it among projects). It is much easier than sharing a bunch of content files. – matra May 11 '12 at 21:59
  • Matra, are you using Web Application Project or Website project? – Sayed Ibrahim Hashimi May 11 '12 at 22:20
  • We are using Web application project. it contains ASCXs with code behind CS files for a components that we want to share with other project. The code behind files are compiled in a DLL. We then use Web Depl project (for the first project) to create classes from ASCX files and compile them into single DLL. So, get 2 DLLS (the first created by the web application project and the second created with web deployment projects). Those two DLLs are all that is needed in to share the user controls with other projects. This is much easier than copying/linking those files in each destination project.. – matra May 12 '12 at 06:40
  • We are also using the same mechanism to common ASCX pages. This requires adding httphandler settings to destination projects web'.config. We sill have to find out how to shaer static file (.CSS, .PNG). It's probably possible to embed them as resources and then use correct URLs in destination projects. Oh BDW, we areu using following settings: EnableUpdateable=false, UseMerge=true – matra May 12 '12 at 06:44
  • 1
    @matra In VS 11 we have built in the ASP.NET compiler/merge into Web Application Project. You can configure it under the Package/Publish Web tab. Then when you package/publish (in your case you can publish to a local directory). Can you try that out and let me know if it suits your needs or do you still need Web Deployment Projects? – Sayed Ibrahim Hashimi May 15 '12 at 03:57
  • We'll probably need to do some MsBuild tweaks, but, it looks like this will cover our use cases. Thanks. – matra May 16 '12 at 06:35
0

We are using pretty straight-up MsBuild to do stuff. The secret is a hidden target called _CopyWebApplication -- that actually copies the built web application and such to a folder.

I have no idea why something this useful is hidden and undocumented.

Wyatt Barnett
  • 15,573
  • 3
  • 34
  • 53
  • If you use _WPPCopyWebApplication instead of _CopyWebApplication, you get all of the web.config transform goodness also, if you use that stuff. – Chris May 11 '12 at 21:26
  • @Wyatt: Are you talking about VS2011 or VS2010. Based on http://msdn.microsoft.com/en-us/library/microsoft.build.tasks.aspnetcompiler.aspnetcompiler(v=vs.110).aspx, the asp.net compiler should be included in .NET 4.5, however I have no idea what level of support will be present in VS2011 (currently there is none). – matra May 11 '12 at 21:57
  • 1
    In VS11 for Web Application Project we have added support for pre-compile in the properties page under Package/Publish Web. FYI in VS11 we also simplified automating publishing. If you want to publish your project to a folder create a new publish profile and give it name, say ToLocal, then from cmd line: msbuild.exe MyWap.csproj /p:DeployOnBuild=true /p:PublishProfile=ToLocal. I will blog about this. – Sayed Ibrahim Hashimi May 11 '12 at 22:23
  • @matra -- .NET 2.0 +, not anything to do with visual studio. If your deployment requires visual studio you are doing it wrong. – Wyatt Barnett May 11 '12 at 23:33
  • @Chris -- nice hint, didn't know that one existed. – Wyatt Barnett May 11 '12 at 23:34
  • 3
    @WyattBarnett In my comment I describe how to publish from the command line. Also your comments of "you're doing wrong" are not adding any value here. Just because you do something a certain way doesn't mean you are doing it right. – Sayed Ibrahim Hashimi May 12 '12 at 01:41