How can I exclude a folder from a .NET installer for a website? - asp.net

We have an installer for a website of ours which works great, I exclude the web.config and a few other files when creating the installer. However I can't seem to exclude a folder. Is this possible?
I've created the installer using the .NET built in Web Setup Project found in the visual studio group Other project types > Setup and Deployment within the new project dialog. This only has the option of including groups of output and excluding files via the filter.

What technology are you using to generate your installer?
Edit after additional info in the question: OK, I haven't worked with the built in Web Setup Project, but I did use a regular setup project once. You control the output of each project that's included in the setup by setting the Build Action property of each content file. Set it to None to exclude a file.
There isn't a Build Action property for a folder, so you'll have to set it for all the files within a folder. If a folder doesn't have any content files, then it shouldn't be included in your setup project.

The only way I found to exclude entire folders and any files within sub-directories was to modify the deployment project which fed into my Installer. Check out the following for information removing folders pre-build:
http://www.meadow.se/wordpress/?p=137
And this for post-build:
http://blogs.msdn.com/webdevtools/archive/2008/10/05/exclude-files-and-folders-from-wdp-output.aspx

Related

Just publish modified controllers, models and some parts of a ASP.NET MVC project

If I change my views (.cshtml) or styles (.css) or scripts (.js) in my MVC projects then I can publish it easily by right click on it and select Publish FILE_NAME
If I changed some controllers files or BLL classes or infrastructure classes,
Which files should be published? which DLLs?
Of course added references must be published but what are another?
Should I publish all the DLL files in the bin folder or just some?
Is there an easy way to VS detect modified files and publish theme by a command or...?
Edit1
I use FTP method to direct publish and upload our site to the server.
My Publish Preview Step Snapshot:
What is the name of DLL files that contains the compiled information of controllers, BLL classes and...?
I just published the MVC5Bootstrap-3-1-1-Less.dll and it worked!
So if we uploaded a website and then want only publish the new modified controllers or classes of the MVC web application (here: MVC5) to the server, we should upload the following files:
MVC5Bootstrap-3-1-1-Less.dll after build
Added references to the bin folder after build
Here is a image of how publish DLLs of bin folder from Visual Studio:
The publish wizard on the project (right click on project > Publish...) should automatically determine which files have changed and need to be updated, and show you what files will be updated.
After clicking Start Preview:

Publish Project to Web Server, Include folders/files in Local Bin

I have a Visual Studio 2013 Web Project with Umbraco and UCommerce imported into the project and a site built out.
The issue is that uCommerce adds a folder called uCommerce in the build directory with all of it's dependency dll's and Publish doesn't include it in the destination.
Is there a way I can set the project file to include all contents in the Bin folder for the publish?
You need to include the uCommerce-stuff as Content in your project. To do this, either
Go through each and every file in the uCommerce folder and add it to your project using "Add -> Existing item...", or, if that's way too many files,
Include the uCommerce folder via a wildcard. You will need to edit your project file manually for this. This SO question has the details (make sure to check out the highest-ranked answer, not just the accepted answer).

Web Application won't publish without .cs files

I have an asp.net web application project that I am publishing via Build > Publish within visual studio 2013. I am publishing to the file system, using the precompile option selected. My project has "Only files needed to run this application" selected in the Package/Publish Web settings screen. However, regardless of what I do, the .cs files (code-behind) and designer.cs files get copied to the output folder during publishing.
This project was created by using the File > New Project > ASP.NET Web Application functionality in visual studio. Then files from a website project were added to the application, and the "convert to web application" command was run on it from the build menu. The conversion to a web app seems to have worked fine, but I am unable to publish without the .cs files being included.
What else needs to be done in order to get a web application to publish without the code-behind files included? Any ideas on what I can look into?
Could there be a setting at the solution level that is causing this? The new web application was added to a pre-existing solution with about a dozen other projects.
Another thing to note is that when I create a new web app with visual studio in a new project, and publish w/ the same settings, it does NOT include the .cs files.
I've also tried deleting and then creating a new publish profile.
I just fixed this by deleting my old publish profile and creating a new one.
The new one appeared to have all the same settings as the old one but when I published it didn't copy the .cs files.
Edit: This answer is a lie. There was a difference between the two profiles. The new profile was in Release configuration.
Edit 2: There's a setting in the project settings which determines what gets published. Select "only files needed to run this application" from the following page.
Turns out that I added this line to my csproj file earlier when I was trying to get my project to build on our build server. Removing it fixed the problem:
<Target Name="GatherAllFilesToPublish"></Target>

SubWebFolder and mutliple bin folders with Website model?

I am looking for some advice on how what is the best approach to subweb folders and having mutliple bin folders in the WebSite Project model. For adding new pages at a later stage without recompiling the core files of a website and without building a full fledged Plug-in framework api. I am aware of being able to drop in the compiled dlls into the main bin folder and to just copy over the new page files to a sub folder but I am looking for a more organized file/folder approach.
Here is the how it was done with WAP:
Moving the Code-Behind Assemblies/DLLs to a different folder than /BIN with ASP.NET 1.1
Multiple /bin folders in ASP.NET
I should also mention that I see that I can still do it the old way with the website project model by making the adjustment to the config section mentioned here but I was wondering if that has any side affects.
AssemblyBinding in Web Config and XMLNS
Are you trying to copy new DLL's or new sources to your site? Note that for sources, the best place in web sites is the App_Code folder. In there, you can create any arbitrary folder structure that you like, and it will all be built at runtime into an assembly. Then, every page gets a reference to that assembly and is able to use types from there.

Web Deployment Project builds files that are no longer part of the project

This is the error I get:
Error 101 Could not load type
'control'. /Test.vbproj/x.ascx 1 1
WebDeployProject
This is a left over file that was part of the project last week, but one of the developers deleted it from the project. I have to manually delete the file in order to get the WDP to build. Is there a way to tell the WDP to ignore the files that are not part of the project or to see that these files are not part of the project and delete them?
You'll need to use your source control tools to find and remove local files that aren't under source control.
For instance, if you're using TFS, do the following:
Open Source Control Explorer (View -> Other Windows -> Source Control Explorer)
Right-click on the path in TFS that corresponds to your local working copy and select Compare
Use your TFS path as Source Path and your local working copy as Target Path
Under View Options, select "Show items that exist only in target path"
You've now got a list of all the files that exist in your local working copy but aren't in source control. For each file, either delete your local copy or add it to source control.
It could have something do to with the type of web project is it.
If it's a web site, then the compiler will attempt to compile every file in the folder. However, if it's a Web Application Project, then it will only compile those that you've specifically added as part of the project.
If you have recently deleted/removed a file from your project then you need go to Project > "Show all files" and all removed files will apear in your solution explorer. You can delete the file, /x.ascx and rebuild your WDP.
It has nothing to do with the type of Web project: http://amiraryani.wordpress.com/2008/11/06/web-deployment-project-aspparse-could-not-load-type/.
A Web Site itself considers files under its root directory as part of the site.
A Web Application Project itself allows you to customize build actions, etc. on a per-file basis.
A Web Deployment Project, however, will try to include files under the root directory (a la a Web Site), even if the WDP is associated with a WAP. That's why it doesn't matter which kind of Web project it is.
EDIT: To clarify, it would matter what type of Web project you are using if you were trying to Build, Debug, or Publish that project itself instead of using a WDP.

Resources