30

When I publish my ASP.net MVC 3.0 Application to IIS 7 using Visual Studio Web Deploy settings one Partial View File is not updated.

Is it possible to debug why it failed for one particular file?

1
  • 2
    I know this is old, but this issue is very likely tied to the files having the same size before and after the changes. Jun 1, 2013 at 19:36

5 Answers 5

49

Select the view that is not publishing to server,
go to properties (click F4) of the view
under properties
check the properties set for it:

  1. Build Action : this should be Content
  2. Copy to Output Directory: this should be like the other file are configured (I believe it should be Do not copy)

Then publish it.

4
  • 3
    Thanks HaBo. Unfortunately I already had those settings so it didn't work, however I deleted the existing files from the server entirely and re-published and that worked. Feb 1, 2012 at 12:56
  • I hadn't used the publish stuff in years as I prefer complete control over my builds.... However I am on contract job were that is what the manager wanted and when it didn't include a newly added folder / files, Your solution fixed the problem. Thanks! May 23, 2012 at 22:59
  • 1
    This doesn't happen often, but when it does it gets me every time. Usually when I add the view using a different method.
    – Cody
    Jan 23, 2015 at 16:54
  • Same thing happened to me, I ended up renaming the partial view and that got it working
    – ThunderDev
    Aug 14, 2017 at 21:49
3

I had a similar problem. I eventually fixed it by tweaking my publish profile in the file Properties\Publish Profiles\ReleaseProfile.pubxml.user.

There was a line in that file that referenced the file that wouldn't publish:

<File Include="Online.master">
    <publishTime>01/01/0001 00:00:00</publishTime>
</File>

I changed the date to one that was still in the past but wasn't ancient:

<File Include="Online.master">
    <publishTime>01/01/2020 00:00:00</publishTime>
</File>

and the file published successfully on my next attempt.

1
  • Good tip. I checked the pubxml.user file and in my case the date for my specific file was written in UK format (dd/MM/yyyy) while all the other dates were in US format (MM/dd/yyyy). (I'm in the UK) Jun 1, 2021 at 16:11
0

for me there was this line in .pubxml file, be sure to check the file contents as some settings are not visible from the configuration editor:

<ExcludeFoldersFromDeployment>Scripts/plugins;Content/icons;fonts</ExcludeFoldersFromDeployment>
0

For me right click on file and publish the file directly resolved this issue.

0

What worked for me in Visual Studio 2022 was to right-click the file/folder in question and publish that separately.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.