pre compile website in Setup & Deployment - c#

Every time I use Setup & Deployment to create a new Web Setup, and run it (after edit all the nice things in the properties), the output is always a copy of the Web Site project...
How can I output a PreCompile version of the WebSite project?
What I did was, publish the Web Site (so I get the precompiled version), add this new precompiled web site as an existing Web site to my solution and add it to the content output of the Setup...
well, the idea was good but I get an error saying:
"This application is already precompiled."
alt text http://www.balexandre.com/temp/stackoverflow_precompiledquestion.png
:-(
Bottom line is that I just want a Setup file that gives me the precompiled version of my Web project, how can I accomplish this?

I see you tried the standard Web Setup project from VS.
Scott Gu's blog post takes you to this page:
Visual Studio 2008 Web Deployment Projects
which is a plugin for Visual Studio that activates an additional "right click" option to any Web Site project to add such a deployment project. You can see here what I created.... And the output is a pre-compiled web application. Now, if you add a regular Web Setup project to your solution, and point it to the previously created Web Deploy project as its content, ... I got a valid build, no errors and an MSI file was created...with dlls inside it.
http://img222.imageshack.us/img222/6177/71881923mj9.jpg
I hope this helps you.

I was searching for this solution from google for long days. What i did is i precompiled my website to one folder and added that folder as a new website to my
solution(While adding it will give a warning message that it was already precompiled content. No probs). Now add this project output to the my setup project and one more important thing is in my web deployment project i just disabled Building of my precompiled
website.
I just got my thinks working. If you want you can try that.
Regards,
Rousseau.A

you may be having "PrecompiledApp.config" file in the root of your web application (please check in solution explorer).
I faced this issue and removed "PrecompiledApp.config" from solution explorer and solved the issue.

Related

ASP.NET MVC 6 project not recognised as web project

I'm developing a small website and I decided to try ASP.NET MVC 6. I wrote some code on my computer and now I want to test it on the server, first in Visual Studio to debug it. I copied the whole solution folder and pasted on the server, but I cannot run the project. VS complains:
The selected debug option is IIS Express but this project is not a web project. To use IIS Express you need to add the wwwroot attribute to project.json.
Google returns nothing for the error message, which is always a bad sign. Apparently there's a problem with the wwwroot folder, but I don't understand what it's trying to tell me. Note that the wwwroot in the solution explorer is displayed as a normal folder (as opposed to the globe icon I have on my dev machine).
I created the project from the template and everything was working out of the box. Did I miss something when copying the project?
Found it. It turns out that ASP.NET 5 runtime was not installed at the server.

TFS Build - Generate Website (no webproject)

I have many projects that I want to build using TFS Build. I have no problems with Windows Forms and WebForms PROJECTS.
But when I try to use TFS Build to build ASP.NET Website (the classic one), I have these problems:
I don't have any options to compile the project with Test Configuration (only Debug or Release).
I can't build an ASP.NET website because it's not a Web Project.
I want to know if there's a way to publish the website's precompiled files to the same shared location where I have my other projects.
I think I might need a bit more detail here, or maybe I'm just clueless :-)
Test configuration - I'm assuming you've set up a Test build configuration? If so, I'm not sure off the top of my head what's going on, but I've seen people forget to create the build configuration.
We've had no problem with our Websites, they get moved to build output or to wherever you specify in the Website properties pages
If you mean you want to use WebDeploy to publish, you're out of luck for the website - only web projects will do that. But do a little team build customization, and you should be able to emulate that.
Not super satisfied with my answer, but hopefully I've pointed you towards something helpful...

Import a web application to IIS programmatically

I have a C# web application developed and web deploy ready - meaning I have the WebApp.Web.zip file ready. I have verified that manual import of this application in my IIS 7.0 manager works and I am able to run the application in the browser.
Open IIS Manager (cmd->inetmgr), and explore the "Sites -> Default Web Site", and click on "Import Application" on the Right menu under Deploy. Browse to the path of the AAA.Web.zip and click "open". Go through the Package Import wizard. Click on "Browse *:80".
I now want to programmatically do the import of this application in the local IIS Server. Could you help me with some pointers?
So If all that you want is to host your WebApplication in IIS, and you don't want to do it all the way manually.
There is a neat way to do so,
Create a WebSetup Project. i.e. Add a New Project into the Solution of your Existing WebApplication i.e. inside visual studio, Add New Project, go to
Other Project Types >>Setup And Deployment >> Visual Studio Installer >> Web Setup Project
Just add Primary Output and Content Files of your WebApplication to the Setup Project and you are done. All you have to do is to build your solution.
And inside the bin folder of your Setup Project, you will get an .exe, which upon installation, hosts the WebApplication in IIS.
see more about creating a setup Project in visual studio
atleast it is cleaner than WebDeploy Command Line Syntax
Just use the webdeploy command line in your buildscript or from a Process object
http://technet.microsoft.com/en-us/library/dd569106(v=ws.10).aspx
Microsoft basically doesn't let you hook in with an API, there are a few ways to hack through it, but honestly you'll be better off using the command line
see this old answer

C# F# MVC 3 template deployment

I've recently started to explore Daniel Mohl "F# C# ASP.NET MVC3" template.
Can anyone share on how this type of project should be deployed to IIS7??
Thanks.
You deploy it pretty much the same way you'd deploy a "normal" ASP.NET MVC3 website, but there is one extra step: you need to make sure your deployed website will have access to FSharp.Core.dll.
If you have admin access to your server, you can simply install the F# redistributable; if not, you'll need to make sure FSharp.Core.dll is included when you publish or create a deployment package. The way I handled this in our website (written in MVC3 with C# + F#) was to manually add a reference to FSharp.Core to the website project, then right-clicked the reference, clicked properties, then set "Copy Local" to true. If you use any assemblies from the F# Powerpack, you'll need to do the same for them.
If I'm correct, the template consists of a C# Web Application that references F# Libraries (DLL) project which contains some of the functionality (namely, controllers and the model).
From the deployment point of view, this is just a normal C# Web Application with some referenced DLLs (created in F#) that will be copied to the bin directory, so the standard deployment procedure should for Web Applications should work just fine. I didn't try it myself now, but try:
Publish application to some folder (right click on C# web project in the solution explorer)
Copy that directory to your web server
Follow the usual IIS configuration steps (see for example here)

Properly using file Designer Files in ASP.NET Web Sites

I need to get existing web pages into an existing ASP.NET web site project in Visual Studio 2008. I simply tried to drag and drop the whole file folder content into the Visual Studio Solution Explorer or even to copy them into the web site folder.
Both ways, Visual Studio seems unable to map the .designer.cs files to the corresponding .aspx (or .master) file, even after restarting the whole IDE. The Solution Explorer entry looks in a way like this:
- Main.aspx
Main.aspx.cs
Main.aspx.designer.cs
Can I make Visual Studio file the designer-file below the aspx-file in any way? I strongly hope there is a simpler way than manually creating each file and copying and pasting the contents into each file by hand.
It sounds like you are trying to bring web application files into a web site. IIf that is the case, The designer files are not even needed. Just dont include them. They are generated and compiled in at runtime when the website runs.
Kind of partially self-answering my question:
In a web project - in contrast to a web site - it works perfectly through drag and drop onto the solution explorer, as I did for the web site before. To make the decision which type of "web site unit" to use there is another thread here on stackoverflow: ASP.NET Web Site or Web Project.
In a web site I can't even use YonahW's solution, because I can't just put files into the proper web site directory without causing them to be added to the web site automatically. Thanks to you anyway, YonahW. :-)
try copying the files through the filesystem and then right clicking on the project and selecting to add an existing item at which point you can choose all at once and this usually puts them in the proper places.

Categories

Resources