VS2012 Publishing Web site lost files

Source: Internet
Author: User

Problem description

When publishing a Web site, it's always true that the online site is missing, and the local code is really fine.

To the disk of the publishing site to view, found that a lot of missing static page files.

This is a very strange problem: the MVC Web site, lost a lot of view (most of the cshtml files have been published successfully, only a few partial publishing failed).

Manually overwrite all of the view to find that the site is working ...

What is the reason for this? Why is the conference missing some static files?


Solution Solutions

Look at these missing and published file attributes in VS, and compare the findings

The publish successful file, the properties in the "Build Action" check the "content" option, and the failed file is "none".

These properties have been modified and I'm trying to publish, and it really worked.


reasons for investigation

Why do these files not have these attributes?

Recall that these files were added to the project operation, I found (in my project), because there are multiple distribution views, so I only created a new distribution view, and then through CTRL + C CTRL + V copied the other view (the process of the suffix problem, modify the prefix), The results were published successfully through vs new distributed maps, and the copied view failed to publish.

With the copied view, if the suffix is modified (the view suffix is. cshtml1), the attribute information is lost.

You also modify the Build Action property of these files after you manually modify them to the correct suffix.


PostScript

This should not be the problem, lead to such a big trouble, but the study to get the final knowledge, is also a kind of harvest.

Take care to sail the boat, blame oneself is not careful.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.