How to Publish WebMatrix site to Local File System? - publishing

Is there any option or workaround to first Publish Webmatrix Website to File System and then upload it manually, as we do in Web Projects and MVC Projects in Visual Studio 2010?

Well I figured it out, publishing WebMatrix Website is just copy-pasting whole website code to production server. But along with this you need to copy all assemblies from C:\Program Files\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\ to Bin directory of website.

..Well I figured it out, publishing WebMatrix Website is just copy-pasting whole website...
Rather discerning,publishing will however do much more than copy paste, especially if transforms are involved...

Related

FTP Publishing Visual Studio 2013

I'm going to host my ASP.NET MVC website in GoDaddy. It says that I have to publish it first before I can host it. I'm following this link (http://www.c-sharpcorner.com/article/how-to-host-your-Asp-Net-mvc-website-on-godaddy-server/) for hosting my website. But when I check the content of my File Manager in my GoDaddy account, some folders of my project is not there (like the App_Data, App_Start, Models) Why is that? Thank you in advance.
I checked the guide you used to publish your website. On step 16 it said to check "Exclude files from App_Data folder". If you check this App_Data folder does not get published. If you want to publish files in app-data folder then uncheck it while publishing.
Secondly, when a website is published, a .dll file is created for each project, so all your classes in app_start and models folder are already included in that .dll. You can find the .dll file in bin folder by the name of your project.

Do I need to install MVC 3/4 on web server to run mvc application

I've a MVC 4 application and runs well on my DEV Machine where I installed MVC 4 extension for VS 2010.
When deploying to the web server with IIS 7, do I need to install MVC 4 or should the dll included on my project is sufficient?
The reason I'm asking is we need to provide the requirement to infrastructure team.
Thanks.
You can run an MVC application without installing MVC on your server. There is something called deployable dependency in Visual studio. That will publish your MVC DLLs in your bin folder when you publish it.
from the msdn page,
This will add assemblies (DLL files) to a Web site project or Web application
project. When you deploy your Web site or application, the files are
included in the deployed project. This is useful if applications or
technologies that your project depends on are not already installed on
the server that will host your Web project. For example, you can use
this feature to deploy an ASP.NET MVC 3 Web application to a server
that does not have ASP.NET MVC 3 installed.
Right Click on Project and Select Add Deployable Dependency from the context menu
Select what all DLLs you want to be published
After clicking OK, You will see a new folder called _bin_deployableAssemblies. You can do normal Publishing procedure now and you will have the dlls in the bin folder of the publish output.
Check this post for more details http://haacked.com/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx
You should have Visual Studio 2010 SP1. Otherwise it will not be shown in the context menu when you right click on the project to be published.
EDIT :
As of MVC4, all necessary assemblies to run an MVC application are automatically added to the bin directory, and any MVC4 application is bin-deployable (means you can run it in a server without explicitly installing MVC) . For this reason, the Include Deployable Assemblies dialog has been removed from Visual Studio 2012
You no longer have the option to "Add deployable dependencies" in Visual Studio 2012. So you'll have to do it manually, by bin deploying all the MVC assemblies:
Microsoft.Web.Infrastructure
System.Web.Helpers
System.Web.Mvc
System.Web.Razor
System.Web.WebPages
System.Web.WebPages.Deployment
System.Web.WebPages.Razor
A step by step guide is found here.
When u create a MVCx specific project in Visual Studio you will see lots of MVC.* references are added to your project and by default all of these reference property "Copy Local" is set as "True" means these references will be part of your final solution whenever you will deploy to. You can also verify that these MVC specific references are also part of your BIN folder.
Finally when you will package this solution and publish to a specific Web Server or to Windows Azure or use WebDeploy, all of these references will be part of your package also. And because these references are shipped in your package so where ever you will deploy the solution, all MVC specific references will be there and because of that you don't need to deploy MVC to those specific servers.
I would also like to add that any time when you add a specific reference to your project in Visual Studio, set its property "Copy Local" to TRUE so that reference will always be part of your final solution, and will save you from trouble in future.
You only need to have the dlls deployed into the bin of your project. For an example of how to prepare your web site for release check out the following blog post:
running-an-asp-net-mvc-3-app-on-a-web-server-that-doesn-t-have-asp-net-mvc-3-installed.aspx.

TFS 2010 not building website (into _PublishedWebsites)

My .sln file has a website (and a few other web applications). The web applications get published to the _PublishedWebsites directory, but not the website. I am not using a custom build configuration. This happens in both Release and Debug mode.
Any ideas?
During the TFS build it checks the project file for Imports which it uses to define the build requirements. The Visual Studio 2010 import for web projects ($(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets) does not contain a definition for the outputting to *_PublishWebsites* as the Visual Studio 2009 one ($(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets) had.
To solve this you need to edit the web application target file on the build server to enable this functionality.
Additional information and assistance can be found at
http://social.msdn.microsoft.com/Forums/zh/tfsbuild/thread/0bd3b8de-0397-41f1-b43a-5ccdd04f9436
http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/559a53e1-2eeb-48e9-a95f-400154b3333f

Export files for xcopy installation of ASP.NET MVC project

I have an ASP.NET MVC project that I'd like to install somewhere using xcopy (as opposed to an installer).
How do I export/build to a folder that I can copy straight to the IIS environment? I think at work we use a web deployment project but that's a plugin and I was wondering if there's another way?
If you're using Visual Studio 2010, you can right-click on the project in Solution Explorer and choose "Publish". This will allow you to publish directly to IIS, via FTP and via FPSE.
For your purposes, though, you can choose the Filesystem option and point it somewhere local. There should be everything you need in that directory to do XCOPY deployment.

What files do I need to deploy for ASP.NET mvc?

I know I can just copy all of my files from my development environment into my live website directory, but then I know I'm copying several files that aren't necessary (e.g. the .sln file and .csproj files).
What files actually have to be copied for ASP.NET MVC web applications to run? (E.g. Do I need to copy all .CS files?)
If you develop in Microsoft Visual Studio, you can use the Build > Publish option (when you're in the context of an ASP.NET MVC project) and publish it directly.
If you cannot use this and have to do a copy all you need is anything that ISN'T a .cs file (views, .config files etc) and your compiled ASP.NET MVC site's .dll (ex MvcApplication1.dll). If you want to get an idea of what you need use the Build > Publish tool to a local directory and take a look at what's in there.
You don't need solution or project files.
Using the Build / Publish approach is the best to ensure you have the files you need. Before building though, if you don't have ASP.NET 3.5 SP1 installed on your server, make sure you go into the references in your project for the following assemblies and set the to "Copy Local" in each of their respective property pages.
System.Web.MVC
System.Web.Routing
System.Web.Abstractions
This will make sure that each of these assemblies is copied to your "bin" folder on the published site.
Brian
After you compile your project, you shouldn't copy all .cs files.
Take a look at this link.
Basically everything but the views get compiled into a dll. You can use the deploy option to see what you need to deploy ;).

Resources