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
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 asp.net mvc 5 application and websetup project in a VS2013 solution. I have added the asp.net mvc5 application as the Project output for the web setup project. Now I have web.config files for Areas, Views section. I have set them with Build Action = Content and Copy to Output Directory = Copy Always. On building the web setup project and deploying it to web server ,I see that there are no web.config files for Areas, Views section in the output. Can anyone help me to know how to resolve this issue ?
The typical setup for an ASP.NET web project does not require copying the web.config to the build folder.
You could selected Build Action "Content" and Copy to Output Directory "Do not copy"
If you Publish your project, the content files will be published. They will not be placed in the bin folder, but rather alongside the app where IIS expects them. The publish step may produce output similar to the following.
Publishing folder bin...
Publishing folder Content...
Publishing folder Scripts...
Publishing folder Views...
Publishing folder Views/Home...
Publishing folder Views/Shared…
If you must use WebSetup (instead of Publish) to deploy the web app, you will want to add the necessary files to the WebSetup FileSystem tab (including content and output).
I've downloaded MyWSAT to review but there is no solution or project files for Visual Studio 2012. So I've created a new solution and have attempted to Add_Existing Items to the new project, however, this won't auto add new folders so I have to manually set up all folders then add the files manually.
I just wanted to know if there is a quicker way of doing this?
Create a solution.
Create a project for the website.
Paste the files in the same folder as the project.
Go back to VS and click the "Show All Files" icon above the solution explorer and include all the files.
Assuming there isn't more configuration necessary, that should work out fine. This is exempt of connection strings, security permissions, etc. but the files are all there and should render fine.
However, this really only works well for a classic ASP website. MVC takes a lot more than that (including wiring up controllers and views) unless those files are included in these "existing files" already.
I have an ASP.NET 4.0 MVC 3.0 website which I have built and published into a directory on my machine ready to FTP to my hosting site. I have two .doc files which exist in a folder under the Content folder. When they were in their own folder, the folder was not included when published. I then included them in the Images folder under Content. When I publish, all the files in the Images folder are included except the two .doc files.
Why are the .doc files being ignored?
I took a closer look at this and I'm pretty sure it has to do with the build action of the files. If you add files such as Word docs and Excel docs to a project, Visual Studio does not include them with the publish by default. However, it will include image files and other similar content by default. To get the files to be included with the publish, right click on the document in Visual Studio and select Properties. Set the Build Action to "Content", and you should be good to go.
I have an existing directory structure that is all nicely checked into SVN, so I don't really want to mess with it.
The website code lives in a folder called C:\Projects\TheProject\Website. I want to bring the website files into a new Web Application Project without changing the directory structure.
Ideally the resulting file structure would look like this:
C:\Projects\TheProject\TheProject.sln
C:\Projects\TheProjects\Website\Website.csproj
No matter what I try I dont get what I want. There is no option to create a web application from existing code. This is very frustrating. Does anyone know if it is possible?
OK I figured it out. It's weird, but the following steps will work:
Open fresh copy of Visual Studio
File->New Project, select Web Application
Use the following settings:
Name: Website (this is the name of the existing folder with the website files in it)
Location: C:\Temp\ (anywhere will do for now)
Solution Name: TheProject (name of the existing project's root folder)
Check "Create directory for solution"
Delete the auto-created Default, Global and Web.config files
Save All and close Visual Studio
In Windows Explorer, copy the new folder on top of the existing folder so that the files are merged.
Double click on the sln file to open Visual Studio again.
Select "Show all files" (at the top of Solution Explorer)
Right click on any files or folders you want to add and select Include in Project.
Have you tried something like this?
Create a new Visual Studio Blank Solution from File-->New Project-->Other Project Types-->Blank Solution, making sure to specify c:\Projects\TheProject as your solution directory.
Copy the folder with all of the existing website stuff into c:\Projects\TheProject\WebSite.
Back in Visual Studio, right-click your solution in Solution Explorer and select "Add Existing Website." Then, pick your c:\Projects\TheProject\WebSite folder.
Good luck, HTH.
Create a new web project with a .csproj file. Delete all the files it comes with. Drag everything into the project.
In the File menu, click Open, and then click Web Site. Choose the root folder where your Web Site is located
On top of #cbp answer I would like to add that if you would like to keep the Version control history of those files - in step 6 - instead of copy do:
git mv original-website/* new-web-application-directory/.
What have you tried? I normally create a blank solution and add existing folders (drag and drop on solution explorer works best), and have not had a problem.
in VS 2008 File->New->Project From Existing Code