HaBo
HaBo

Reputation: 14317

Visual Studio Web Deploy not publishing all Files

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?

Upvotes: 30

Views: 20223

Answers (6)

Don Lahey
Don Lahey

Reputation: 1

I had manually edited the Target Location and left off the colon after the drive letter. It never gave an error but never published.

Upvotes: 0

Kofi Ackaah
Kofi Ackaah

Reputation: 1

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

Upvotes: 0

Francis Pires
Francis Pires

Reputation: 25

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

Upvotes: 0

mohas
mohas

Reputation: 1931

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>

Upvotes: 0

samHumeniuk
samHumeniuk

Reputation: 119

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.

Upvotes: 3

HaBo
HaBo

Reputation: 14317

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.

Upvotes: 50

Related Questions