I am publishing a web application from Visual Studio 2010 in IIS. The solution structure is depicted below:
Now everything is fine, except the Log4Net.xml is copied into the bin directory of the published forlder, while Data.xml is copied in right place. So I am manually copying the Log4Net.xml.
Why this is happening? Is there any script I can write for this publishing process?
Right click on Log4Net.xml and go to Properties.
Change the Build Action from 'Embedded Resource' to 'Content'
Change Copy to Output Directory to 'Copy always'.
You can control how the resource is handled by looking at the properties of the file in Visual Studio. There's a property "Copy to output directory", which will cause it to be sent to the "bin" folder on publish. There's another property "Build Action", which you can set to compile, resource, embedded resource, etc. Check those two properties for the file that's getting deployed correctly, and you should be good to go.
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 have checked the answer for VS 2012, it did not work. I do not precompile, I have "Debug Info" set to "full", "Items to deploy" set to "Only files needed to run this application" and "Exclude generated debug symbols" not marked.
I have tested with "All files in this project", and I have tried to edit the pubxml file. Besides not working I cannot find the file schema documentation.
Please help.
After a lot of tests, I noticed that "Exclude generated debug symbols" flickered as marked during the publish processing. My error was that I was editing the Active configuration -- which was Debug -- and not the Release configuration used in my publish process.
Please verify the Configuration combo on the project properties page, this was bizarre until I noticed that.
ThereĀ“s an option in the Advanced Precompile Settings dialog (which is off by default); you find this dialog via the Settings tab of the Publish Web wizard... watch out for the (unoticable) Configure-link in the File Publish Options-drop-down...
I've searched for this and tried every trick posted and nothing worked.
The only thing that worked for me was to take a copy of the bin folder and then delete all files from the bin folder and rebuild.
When publishing I got a new error of a missing .dll which I had in the backup folder. When I copied it to the bin folder I was finally able to publish.
I'm building an application which is written with Qt in Visual Studio 2008. Everything is OK and I can run the output, but the executable file depends on some other files to be loaded at run-time. These files need to be copied along with the .EXE file every time they are changed, as I need to run the released output outside the IDE.
Is it possible to copy some files/folder in the output directory right besides the .EXE file during project build-time?
Here is how it's done:
Go to your solution explorer and open project properties
Select "Build events" tab
Enter post build command. You can also use Macros (not sure for VS2008. VS2010 already supports them)
Here is good resource for build events from where you can continue further:
http://msdn.microsoft.com/en-us/library/42x5kfw4(v=vs.80).aspx
If using Visual Studio right mouse click the file you want copied to the output folder, select Properties. In the Advanced section, the second option is: Copy to Output Directory. By default this is "Do not copy". Select the other options as desired such as "Copy always" or 'Copy if newer". These properties will be saved to your .csproj file.
I have a WCF project with a single .svc file and some .config files in it. I'm trying to create a build definition in TFS 2010 that will copy these files to an IIS folder on another machine.
I've done similar things with other MVC projects using the CopyDirectory task in the build XAML template. In those, I copy from the _PublishedWebsites folder to the IIS folder. However, with the WCF project, there is no _PublishedWebsites folder.
So I tried updating the MSBuild script for the WCF project to create a _PublishedWebsites folder and copy the files to it. This works when I build locally in Visual Studio 2010. But when it runs on the TFS build server, it doesn't quite work.
What I see there is that in "C:\Builds\1\PROJECT\PROJECT (Continuous Build)\Sources\PROJECT\bin\_PublishedWebsites", I can see all the files.
I'm guessing this "1 folder" is a temporary folder used for building...? I'm not sure what it's used for. But when I look at the actual drop location for the build, in "C:\Builds\PROJECT (Continuous Build)\PROJECT_BUILDNUMBER\", I see nothing except log files. None of the files from the "1 folder" are there.
Note that this same solution also has a WiX project to create a deployment package. That seems to build fine, and shows up in the drop location with no issue.
"1 folder" is a temporary folder used for building
Yes. "1" is number of build agent(service that actually executes builds activities) on your build machine.
But when I look at the actual drop location for the build, in "C:\Builds\PROJECT (Continuous Build)\PROJECT_BUILDNUMBER\", I see nothing except log files.
- Usually "Copy Files To Drop Location" flag is responsible for that.
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