.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

MSBuild on MVC Publish

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :ASP.Net


I am publishing a MVC web site but I need to do some changes on the output. 

I am using MSBuild for that:

  <Target Name="Publish">
    <MSBuild.ExtensionPack.FileSystem.Folder TaskAction="Move" Path="$(OutputFolder)Styles" TargetPath="$(OutputFolder)Styles_Temp"/>

This is not taking any affect. 

Does anyone knows how to use MSBuild on the Publish target of a MVC Application?



View Complete Post

More Related Resource Links

Why isn't my Views/Home/Home.Master file published when I publish my website?


Hi All,

I spent the better part of today hunting down an elusive error.  I was getting a message saying that it couldn't find the Index view for the Home controller, and it gave a list of locations it searched, e.g., ~/Views/Home/Index.aspx.  This was really confusing as the file definitely existing and was at ~/Views/Home/Index.aspx, the first place in the list of locations it searched for the view!

What I eventually discovered was that there was a file that did not get published when I used Visual Studio's "Publish" feature (this is on the "Build" menu).  That file was Views/Home/Home.master, and (as you can probably guess) is the master file used by Views/Home/Index.aspx.

Once I copied that file into place manually, it started working.  But I am left wondering--why???  Why does this file not get published?  It's a part of my project, I can see it in the solution explorer, and it's obviously a critical file that's necessary for the MVC app to run.  It has the same permissions as every other file in my project.  So why wouldn't it get copied?  And how can I fix it so it does get copied?

Thanks for any suggestions on this!


OutputPath and MSBuild



I have a solution with 3 wdproj files to allow different deployments of our site.  I'm using NAnt with an MSBuild task to compile the solution file which in turn is building the deployment projects.  The problem I have is that the OutputPath property used by each of the deployment projects is inherited from the solution file which means I am getting the following error:

ASPNETCOMPILER : error ASPRUNTIME: The target directory is not empty, and does not appear to contain a previously compiled application. Please delete it manually, or choose a different target

Can anybody suggest what I can do to rectify this?  From what I've read it should be the solution file that gets compiled by MSBuild rather have each deployment project built separately.

By the way the solution contains a number of class libraries and a web application.

Thanks in advance.



MSBuild: Best Practices For Creating Reliable Builds, Part 2


Find out here how you can use MSBuild to better manage and control large build projects in Visual Studio.

Sayed Ibrahim Hashimi

MSDN Magazine March 2009

MSBuild: Best Practices For Creating Reliable Builds, Part 1


This article describes some basic practices and techniques that you can use in MSBuild to better manage and control your build projects in Visual Studio.

Sayed Ibrahim Hashimi

MSDN Magazine February 2009

Inside MSBuild: Compile Apps Your Way With Custom Tasks For The Microsoft Build Engine


Learn how you can use MSBuild to customize your builds. Since it ships as a part of the .NET Framework, you don't even need to have Visual Studio installed on your machine.

Sayed Ibrahim Hashimi

MSDN Magazine June 2006

.NET Web Services: Web Methods Make it Easy to Publish Your App's Interface over the Internet


Web Services are a great way to accept and manage contributions to a public clip art library, digital music catalog, or corporate knowledge base. Since the SOAP interface to a Web method operates over HTTP, contributors can easily publish content any time, from anywhere across the Internet. However, accepting binary content and managing content metadata through SOAP over HTTP presents Web Service developers with some interesting design decisions. This article discusses three ways to enable content publishing using Web methods.

Paula Paul

MSDN Magazine March 2002

When I use 'publish', site doesn't work when i post data


Arrgghh, I am so tired of dealing with stuff like this

I've got a project, when I put up on another server I point two sites in IIS6 to it

i have

http://www.main.com  pointing to the folder the files are in


http://www.anotherofoursites.com/main pointing to that same folder in it's own "Virtual Application" or whatever IIS calls it when you put a folder into it's own 

If I just "Build" and push all the files up.. both work without issue and as expected...  but when I use "Publish" to precompile, the site works until I post, and then i get nailed with:

Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

publicly publish some data from wiki pages


We have internal sharepoint site for the staffs which also has wiki pages. We want that wiki pages as public; publish some data from wiki pages.

To do this, one of my friend suggest me to do this:

"For exposing stuff publicly from SharePoint, you can do it using the SOAP interface from SharePoint and using .NET to make an app to read it. "

I'm just beginner of the sharepoint and I'm unable to follow his suggestion. This is not the easy step. 

Is anybody has some thoughts, ideas and some samples, if possible that would be great ?

I really appreciated. Thanks in advance.


How to publish my wcf-service?

Hello!   I've added ServiceContract-class to my .NET dll. After that I've created a web-site in my IIS6 and Service.svc with only one line: <%@ServiceHost Service="MySpaceName.WCFService" %> And Web.config: <system.serviceModel> <services> <service name="MySpaceName.WCFService.Service1"> <endpoint address ="" binding="wsHttpBinding" contract="MySpaceName.WCFService.IService1" /> </service> </services> </system.serviceModel> But at http://localhost:81/Service.svc I can see only page no 404 :-( All dll-s was copied to the directory "bin". Could you please help me to find my mistake.-- Alexey

Report viewer problem in Publish Website

hi all,          I have done website designing and i published that website in vs2005 after that i transfer to iis webroot. when i open the report viewer page i got the below error,An error occurred during local report processing.    The definition of the report 'Main Report' is invalid.      The report definition is not valid. Details: Data at the root level is invalid. Line 1, position 1.the same reportviewer page opened when i was upload to webroot without publishing website..i added all report dll file, but i got the above error (published website)Thank You,Arunabathan.G  

Can not connect to my SQL server from the publish server

I have created a simple website, Iam connecting to a database the is not located in local-newtwork. Connection from development machine works fine, The problem occurs when I publish the website on my server, than it can not connect to the server, Iam pinging the server I no packets are lost, I don't why it can not connect to the database server?

Publish Sharepoint Foundation Server to Internet

Hi guys, first of all I don't want exactly to publish SPF server to Internet, but place it in DMZ and make available from Internet. So I won't have any dedicated web server, only one server with MSSQL and SPF on it. Is there any practices to make it more secure? So far I'm only came up with form authentication... Any ideas or links are highly appreciated!

How do I publish public facing SharePoint site(on internet)?

I developed public facing SharePoint 2010 portal publishing website using Window Server 2008 R2 and SharePoint 2010 Server and SPD 2010 on my computer. I have custom master page, page layout, css…. I want to publish it(on the internet).  I want to know cheap host and domain name service provider Company and steps to do it. I’ appreciate any advice in advance.

Running the "Publish WebSite" option in VS

A few months ago I ran accross a web site that explained the advantage of running a build on your website via the Publish WebSite optoin but I really did not pay much attention to it back then because I was just starting out.  Now I have two large website projects I am working on that take a very long time to load a page that was changed or any page after the server is restarted. One thing I do remember from that site was that doing the publish on my webpage would fix this long load time. I have tried to find that page (or other pages that explain the publish process and how to use it) but I can't everything I come up with is on uploading websites and such but not on the VS process, I tried using the built in VS help but even after a reinstall it is broken and says the help is not installed. Can anyone either anwser the following (probibily simple questisons) or point me to a website that can? 1. What do all the options in the Publish Website do? 2.  What is the difference between running the Publish Website and running the Build WebSite?

Invalid URL error on InfoPath Form Publish on an External List

I am using SP2010 Enterprise on Windows 7 and SPD 2010 & InfoPath 2010 all on the same machine in test.  I create an External List based on a ECT and Click on the 'Design Forms in InfoPath' icon and 'Item' which drops down from it.  That launches InfoPath Designer 2010 & downloads the form from http://<site>/lists/<mylistname>/Item/template.xsn and sets you up in an edit session.  I can make changes on the form but when I publish via File | Publish | External List (Publish Form To An External List) I get a save prompt for local copy & then an error: The following URL is not valid: http://<site>/lists/<mylistname>/Item/template.xsn  (same URL as it started with during the initial download). I took screen shots of the messages to make sure. Some things I have tried & observations: If I change to an internal Custom List the publish step (to list not external of course) works just fine. I also ran this test launching SPD as Administrator with no difference.  I stopped the System Event Notification service per http://serena-yeoh.blogspot.com/2006/08/infopathformurlnotvalid.html  'net stop sens' with no difference Any ideas are welcome. BTW I notice that this step of launching the InfoPath designer does change the form on the list in Sharepoint albeit slightly -

Cannot publish InfoPath 2010 form template to SharePoint Server 2010 RC

Hi all, I am MSFT in Vietnam. I created a SharePoint list using InfoPath 2010 RTM 64bit. After publishing it to SharePoint 2010 RC, I see an error message:  Click on button "Show Details" the message is The list schema does not match the schema of this form. Refresh the data source and publish the form again. When I create new item based on published SharePoint list, I can see plain form not browser enabled InfoPath form. I checked InfoPath Form Services, everything seems to be good. What should I do to publish SharePoint list from InfoPath 2010 to SharePoint 2010 as browser enabled form?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend