Reputation: 743
There's a single remote file that's not getting overwritten with the new version each time I publish my VS project. It's a partial view in my Views/Shared folder. It's definitely included in the project.
The Build Action is Content
(like all other files in folder)
Copy to Output Directory is set to Do not copy
(like all other files in folder)
I've checked the permissions for the file, and it's Read / Write, like all other files in the folder.
The date/time-stamp of the file on the server is older than the one on my local dev machine.
It's possible this file may have been manually edited on the server at some point. Would this affect things?
As per the suggestions in this (unresolved) question...
Why won't visual studio include a file in publish output?
... I ran the Build in Diagnostic mode, and everything looked fine. I also searched all other folders on the remote server to see if the new version of the file may have ended up somewhere else. It had not.
I could solve the problem temporarily by uploading the file manually, but this issue may reoccur down the track. Plus, then I'm no longer 100% certain that all other files are getting published.
Here's my .pubxml file
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FTP</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>http://XXXXXX.com.au</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>ftp://XXX.X.XXX.XX</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
<FtpPassiveMode>True</FtpPassiveMode>
<FtpSitePath>XXXXXX.com.au\wwwroot</FtpSitePath>
<UserName>xxxxxxx</UserName>
<_SavePWD>True</_SavePWD>
</PropertyGroup>
</Project>
Here's my .SLN file
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CMS", "CMS\CMS.csproj", "{0EABB8B8-2784-4BBA-B2E8-5D7B4A302182}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0EABB8B8-2784-4BBA-B2E8-5D7B4A302182}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0EABB8B8-2784-4BBA-B2E8-5D7B4A302182}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0EABB8B8-2784-4BBA-B2E8-5D7B4A302182}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0EABB8B8-2784-4BBA-B2E8-5D7B4A302182}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Upvotes: 0
Views: 1797
Reputation: 552
Try to publish to a local folder first, and check the result, fix any problem.
Also check your solution/project file in a text editor outside visual studio. Find your partial view reference in the project file and compare to other items, maybe there is some difference. You can edit the project file direct in VS if you installed productivity power tools, and select unload project in solution explorer.
The project file may contains post build events to manipulate files, check if you have any.
The publish profile file (*.pubxml), may have some element which manipulate the published files like ExcludeFoldersFromDeployment.
Because you modified you file manually on the server, deploy may think the modified file is newer than the published one and skip it.
Setting
<DeleteExistingFiles>True</DeleteExistingFiles>
force deploying all files always.
Upvotes: 1