Q1. How can I (if I can) publish a website project with source code? Whenever I publish my website, it converts .cs files to DLLs in bin folder. But I want it to pe published with cs files and all refered external DLLs
Q2. When I publish a web application project, it gives publish/package settings options which is not available for website projects. This setting tab does give options to copy with source code but it creates many other unwanted files like config.debug, config.release etc. How can I make it publish application with files already in the project and nothing new.
Use "Copy site" instead of "Publish site" (right click on the web project or click "Web site" menu).
Related
I am using Team Foundation Server 2013 and have the nightly build configured to deploy a web application. The web application is making use of the web API help pages which depend on the built in XML documentation files.
I currently have these XML files being output to the App_Data folder. These are not being copied to the server during deployment. I tried checking in the documentation files but when the build process tried to regenerate them it caused an access error as the files are read-only.
I currently have a placeholder text file inside the App_Data folder included in the project to ensure that the folder gets created but I have to manually copy across the documentation files in order for the help pages to work as intended.
What is the correct/best way of forcing these files to be copied?
Thanks
Ensure the project build order has the docs being built first. Right click on the solution and choose Project Build Order
Then add some MSBuild logic in your pubxml or wpp.targets file to add the generated help files to the FilesForPackagingFromProject ItemGroup.
http://sedodream.com/2012/10/09/VSWebPublishHowToIncludeFilesOutsideOfTheProjectToBePublished.aspx
Open the solution, right click on the .xml file, click Properties, for 'Copy to Output Directory' select 'Copy Always'.
i am working on an web application which is used to send data to devices which is connected in a network(LAN). software is able to send data when it is published through visual studio 2010 and when i am publishing on IIS 6 this software is not able to send data on devices.
(From MSDN)
To publish a Web application project
In the Build menu, click Publish ProjectName.
The Publish Web dialog box is displayed.
Click the ellipsis button (…) to browse to the location that you
want to publish the Web application project to.
Select the Replace matching files with local copies check box or the Delete all existing files prior to publish check box.
Select how you want to copy the Web application project files to the new location by using Only files needed to run this application, All project files, or All files in the source project folder.
You can include files from the App_Data folder by selecting the corresponding check box.
Click OK to publish the Web application project.
In the task bar, Publish succeeded is displayed when publishing has finished.
Make any configuration changes that are required for the Web application at the target location.
For more information, see How to: Configure Published Web Site Projects.
Hope it helps
What is the difference between these 2 windows in a given project in Visual Studio?
Am I correct in assuming that the first pic is the settings of what the project does when it gets published, while the second pic is the dialog to get the Publish profile setup?
You see this one when you right-click the Project settings, and click Properties.
This one you get to from the Menu, Build --> Publish {project name}
The project dialog represents common deployment options. The publish dialog allows you to configure "Publish Profiles" that publish/package to specific locations.
It's possible to override the common deployment options in your publish profiles' pubxml files via <PropertyGroup>, but there is no UI for it.
I'm using Visual Studio 2010 with the new website publish dialog. I have a Web Application website. When published, in theory it should compile all the code into an single assembly. However, in both Debug and Release, after publishing the directory always contains source code of page and user controls (even with the untransformed web.config files Web.Debug.config and Web.Release.Config). This is very confusing.
But with package/publish web project configuration and Generate Deploy package context menu item, the Package\PackageTmp directory is clean.
Why doesn't Visual Studio use this Package to publish the website?
Where is the precompile option?
Web.config xml transform seems not work, why does Visual Studio bring this feature to confuse me?
The correct answer is to look in the Package/Publish Web settings (in the web application project properties) and look for the "Items to deploy".
For a web application you'd want "Items to deploy" to have "Only files needed to run this application" which would NOT copy the source code files, since they've been compiled into the DLL in the bin folder.
Note that this setting varies for your current Build type (Debug/Release/etc), so plan accordingly...
Ciao!
You need to understand the differences between Web Application Projects versus Web Site Projects.
To deploy a Web application project, you copy the assembly that is
created by compiling the project to an IIS server. In contrast, to
deploy a Web site project, you typically copy the project source files
to an IIS server.
For Web application projects, you typically build the project in
Visual Studio or by using the ASP.NET batch compiler on a computer
that is not the production IIS server. All code-behind class files and
standalone class files in the project are compiled into a single
assembly, which is then put in the Web application project's Bin
folder. (The .aspx and .ascx files are compiled dynamically in a
manner similar to what is done for Web site projects.)
For Web site projects, you do not have to manually compile the
project. Web site projects are typically compiled dynamically by
ASP.NET (on both the development computer and the production IIS
server). You can choose between batch compilation mode, which
typically produces one assembly per folder, and fixed compilation
mode, which typically produces one assembly for each page or user
control.
In visual studio 2013/2015, select an option "Precompile during publishing"
we are developing a web application using MVC3 and VS2010. We have some pdf files under Content\PDFFiles folder. when we publish the website to our server using "File System" publish method, it does not copy the "PDFFiles" folder to the server. however it is copying the other folders (images, themes) from "content" folder. "PDFFiles" folder is additionally added to have pdffiles used by our web application.
anyone know the reason behind it?
Thanks,
In the Visual Studio Solution Explorer when you right-click on each of the items (files) and select Properties what is the Build Action? Is it Content? If not give that a try.
You can also include an extra folder with all its contents editing the publish profile: http://www.asp.net/mvc/tutorials/deployment/visual-studio-web-deployment/deploying-extra-files