0

Hi am trying to PUBLISH Visual Studio solution files using MSBuild. I am able to publish using visual studio 2015, whereas when am trying to Build and publish the site using MSBuild. I see that the build is successful and the output directory path getting created with some dll's and not the entire project. The solution had multiple projects, I broke the solution into individual projects and started building individually. With similar approach i was able to build and publish another project individually but when am trying to publish this, all i get to see is 4 warnings and build to be successful. any help would be much appreciated.

Following cmd was run to build and publish:

C:\Program Files (x86)\MSBuild\14.0\Bin>MSBuild E:\CI\CorpAppSource_Timesheet\Co
nsilio.IMS.sln /t:build /p:VisualStudioVersion=14.0 /p:Configuration=Release /p:
DeployOnBuild=false /p:OutputPath=E:\Naresh

Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
Build started 1/9/2017 7:51:26 AM.
Project "E:\CI\CorpAppSource_Timesheet\Consilio.IMS.sln" on node 1 (build targe
t(s)).
ValidateSolutionConfiguration:
  Building solution configuration "Release|Any CPU".
Project "E:\CI\CorpAppSource_Timesheet\Consilio.IMS.sln" (1) is building "E:\CI
\CorpAppSource_Timesheet\IMS.Library\Library.csproj" (2) on node 1 (default tar
gets).
PrepareForBuild:
  Creating directory "E:\Naresh\".
ResolveAssemblyReferences:
  Could not read state file "obj\Release\Library.csprojResolveAssemblyReference
  .cache". The format of this state file is not valid.
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output fi
les are up-to-date with respect to the input files.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with resp
ect to the input files.
_CopyFilesMarkedCopyLocal:
  Copying file from "E:\CI\CorpAppSource_Timesheet\IMS.Library\3rd Party Librar
  ies\log4net.dll" to "E:\Naresh\log4net.dll".
_CopyAppConfigFile:
  Copying file from "app.config" to "E:\Naresh\IMS.Library.dll.config".
CopyFilesToOutputDirectory:
  Copying file from "obj\Release\IMS.Library.dll" to "E:\Naresh\IMS.Library.dll
  ".
  Library -> E:\Naresh\IMS.Library.dll
  Copying file from "obj\Release\IMS.Library.pdb" to "E:\Naresh\IMS.Library.pdb
  ".
Done Building Project "E:\CI\CorpAppSource_Timesheet\IMS.Library\Library.csproj
" (default targets).

Project "E:\CI\CorpAppSource_Timesheet\Consilio.IMS.sln" (1) is building "E:\CI
\CorpAppSource_Timesheet\FADV.IMS\IMS.Core\FADV.IMS.Core.csproj" (3) on node 1
(default targets).
Project "E:\CI\CorpAppSource_Timesheet\FADV.IMS\IMS.Core\FADV.IMS.Core.csproj"
(3) is building "E:\CI\CorpAppSource_Timesheet\FADV.Util\FADV.Util.csproj" (4)
on node 1 (default targets).
ResolveAssemblyReferences:
  Could not read state file "obj\Release\FADV.Util.csprojResolveAssemblyReferen
  ce.cache". The format of this state file is not valid.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with resp
ect to the input files.
CopyFilesToOutputDirectory:
  Copying file from "obj\Release\FADV.Util.dll" to "E:\Naresh\FADV.Util.dll".
  FADV.Util -> E:\Naresh\FADV.Util.dll
  Copying file from "obj\Release\FADV.Util.pdb" to "E:\Naresh\FADV.Util.pdb".
Done Building Project "E:\CI\CorpAppSource_Timesheet\FADV.Util\FADV.Util.csproj
" (default targets).

Project "E:\CI\CorpAppSource_Timesheet\FADV.IMS\IMS.Core\FADV.IMS.Core.csproj"
(3) is building "E:\CI\CorpAppSource_Timesheet\FADV.IMS\IMS.Core.Base\FADV.IMS.
Core.Base.csproj" (5) on node 1 (default targets).
Project "E:\CI\CorpAppSource_Timesheet\FADV.IMS\IMS.Core.Base\FADV.IMS.Core.Bas
e.csproj" (5) is building "E:\CI\CorpAppSource_Timesheet\FADV.IMS\IMS.Data\FADV
.IMS.Data.csproj" (6) on node 1 (default targets).
ResolveAssemblyReferences:
  Could not read state file "obj\Release\FADV.IMS.Data.csprojResolveAssemblyRef
  erence.cache". The format of this state file is not valid.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with resp
ect to the input files.
CopyFilesToOutputDirectory:
  Copying file from "obj\Release\FADV.IMS.Data.dll" to "E:\Naresh\FADV.IMS.Data
  .dll".
  FADV.IMS.Data -> E:\Naresh\FADV.IMS.Data.dll
  Copying file from "obj\Release\FADV.IMS.Data.pdb" to "E:\Naresh\FADV.IMS.Data
  .pdb".
Done Building Project "E:\CI\CorpAppSource_Timesheet\FADV.IMS\IMS.Data\FADV.IMS
.Data.csproj" (default targets).

ResolveAssemblyReferences:
  Could not read state file "obj\Release\FADV.IMS.Core.Base.csprojResolveAssemb
  lyReference.cache". The format of this state file is not valid.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with resp
ect to the input files.
CopyFilesToOutputDirectory:
  Copying file from "obj\Release\FADV.IMS.Core.Base.dll" to "E:\Naresh\FADV.IMS
  .Core.Base.dll".
  FADV.IMS.Core.Base -> E:\Naresh\FADV.IMS.Core.Base.dll
  Copying file from "obj\Release\FADV.IMS.Core.Base.pdb" to "E:\Naresh\FADV.IMS
  .Core.Base.pdb".
Done Building Project "E:\CI\CorpAppSource_Timesheet\FADV.IMS\IMS.Core.Base\FAD
V.IMS.Core.Base.csproj" (default targets).

Project "E:\CI\CorpAppSource_Timesheet\FADV.IMS\IMS.Core\FADV.IMS.Core.csproj"
(3) is building "E:\CI\CorpAppSource_Timesheet\FADV.IMS\IMS.Security\FADV.IMS.S
ecurity.csproj" (7) on node 1 (default targets).
ResolveAssemblyReferences:
  Could not read state file "obj\Release\FADV.IMS.Security.csprojResolveAssembl
  yReference.cache". The format of this state file is not valid.
CoreResGen:
  No resources are out of date with respect to their source files. Skipping res
  ource generation.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with resp
ect to the input files.
CopyFilesToOutputDirectory:
  Copying file from "obj\Release\FADV.IMS.Security.dll" to "E:\Naresh\FADV.IMS.
  Security.dll".
  FADV.IMS.Security -> E:\Naresh\FADV.IMS.Security.dll
  Copying file from "obj\Release\FADV.IMS.Security.pdb" to "E:\Naresh\FADV.IMS.
  Security.pdb".
Done Building Project "E:\CI\CorpAppSource_Timesheet\FADV.IMS\IMS.Security\FADV
.IMS.Security.csproj" (default targets).

ResolveAssemblyReferences:
  Could not read state file "obj\Release\FADV.IMS.Core.csprojResolveAssemblyRef
  erence.cache". The format of this state file is not valid.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with resp
ect to the input files.
GenerateSerializationAssemblies:
Skipping target "GenerateSerializationAssemblies" because all output files are
up-to-date with respect to the input files.
_CopyAppConfigFile:
  Copying file from "app.config" to "E:\Naresh\FADV.IMS.Core.dll.config".
CopyFilesToOutputDirectory:
  Copying file from "obj\Release\FADV.IMS.Core.dll" to "E:\Naresh\FADV.IMS.Core
  .dll".
  FADV.IMS.Core -> E:\Naresh\FADV.IMS.Core.dll
  Copying file from "obj\Release\FADV.IMS.Core.XmlSerializers.dll" to "E:\Nares
  h\FADV.IMS.Core.XmlSerializers.dll".
  Copying file from "obj\Release\FADV.IMS.Core.pdb" to "E:\Naresh\FADV.IMS.Core
  .pdb".
Done Building Project "E:\CI\CorpAppSource_Timesheet\FADV.IMS\IMS.Core\FADV.IMS
.Core.csproj" (default targets).

Project "E:\CI\CorpAppSource_Timesheet\Consilio.IMS.sln" (1) is building "E:\CI
\CorpAppSource_Timesheet\Timesheet.metaproj" (8) on node 1 (default targets).
E:\CI\CorpAppSource_Timesheet\Timesheet.metaproj : warning MSB3274: The primary
 reference "E:\Naresh\IMS.Library.dll" could not be resolved because it was bui
lt against the ".NETFramework,Version=v4.5" framework. This is a higher version
 than the currently targeted framework ".NETFramework,Version=v4.0".
  Copying file from "E:\Naresh\FADV.IMS.Security.dll" to "..\CorpAppSource_Time
  sheet\FADV.IMS\Timesheet\\Bin\FADV.IMS.Security.dll".
  Copying file from "E:\Naresh\FADV.IMS.Data.dll" to "..\CorpAppSource_Timeshee
  t\FADV.IMS\Timesheet\\Bin\FADV.IMS.Data.dll".
  Copying file from "E:\Naresh\FADV.Util.dll" to "..\CorpAppSource_Timesheet\FA
  DV.IMS\Timesheet\\Bin\FADV.Util.dll".
  Copying file from "E:\Naresh\FADV.IMS.Core.Base.dll" to "..\CorpAppSource_Tim
  esheet\FADV.IMS\Timesheet\\Bin\FADV.IMS.Core.Base.dll".
  Copying file from "E:\Naresh\FADV.IMS.Security.pdb" to "..\CorpAppSource_Time
  sheet\FADV.IMS\Timesheet\\Bin\FADV.IMS.Security.pdb".
  Copying file from "E:\Naresh\FADV.IMS.Data.pdb" to "..\CorpAppSource_Timeshee
  t\FADV.IMS\Timesheet\\Bin\FADV.IMS.Data.pdb".
  Copying file from "E:\Naresh\FADV.Util.pdb" to "..\CorpAppSource_Timesheet\FA
  DV.IMS\Timesheet\\Bin\FADV.Util.pdb".
  Copying file from "E:\Naresh\FADV.IMS.Core.Base.pdb" to "..\CorpAppSource_Tim
  esheet\FADV.IMS\Timesheet\\Bin\FADV.IMS.Core.Base.pdb".
  Copying file from "E:\Naresh\FADV.IMS.Core.dll" to "..\CorpAppSource_Timeshee
  t\FADV.IMS\Timesheet\\Bin\FADV.IMS.Core.dll".
  Copying file from "E:\Naresh\FADV.IMS.Core.pdb" to "..\CorpAppSource_Timeshee
  t\FADV.IMS\Timesheet\\Bin\FADV.IMS.Core.pdb".
  Copying file from "E:\Naresh\FADV.IMS.Core.XmlSerializers.dll" to "..\CorpApp
  Source_Timesheet\FADV.IMS\Timesheet\\Bin\FADV.IMS.Core.XmlSerializers.dll".
  C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v /Timeshe
  et -p ..\CorpAppSource_Timesheet\FADV.IMS\Timesheet\ -u -f PrecompiledWeb\Tim
  esheet\
e:\CI\CorpAppSource_Timesheet\FADV.IMS\Timesheet\App_Code\TimeSheetService.cs(3
72): warning CS0108: 'TimeSheetService.oSecurityRoot' hides inherited member 'I
MSUserPermission.oSecurityRoot'. Use the new keyword if hiding was intended. [E
:\CI\CorpAppSource_Timesheet\Timesheet.metaproj]
e:\CI\CorpAppSource_Timesheet\FADV.IMS\Timesheet\App_Code\TimeSheetService.cs(3
83): warning CS0108: 'TimeSheetService.oSystemRoot' hides inherited member 'IMS
UserPermission.oSystemRoot'. Use the new keyword if hiding was intended. [E:\CI
\CorpAppSource_Timesheet\Timesheet.metaproj]
e:\CI\CorpAppSource_Timesheet\FADV.IMS\Timesheet\UserControls\ParentObjectMenuU
C.ascx.cs(744): warning CS0618: 'System.Xml.XmlDataDocument' is obsolete: 'XmlD
ataDocument class will be removed in a future release.' [E:\CI\CorpAppSource_Ti
mesheet\Timesheet.metaproj]
Done Building Project "E:\CI\CorpAppSource_Timesheet\Timesheet.metaproj" (defau
lt targets).

Done Building Project "E:\CI\CorpAppSource_Timesheet\Consilio.IMS.sln" (build t
arget(s)).


Build succeeded.

"E:\CI\CorpAppSource_Timesheet\Consilio.IMS.sln" (build target) (1) ->
"E:\CI\CorpAppSource_Timesheet\Timesheet.metaproj" (default target) (8) ->
(Build target) ->
  E:\CI\CorpAppSource_Timesheet\Timesheet.metaproj : warning MSB3274: The prima
ry reference "E:\Naresh\IMS.Library.dll" could not be resolved because it was b
uilt against the ".NETFramework,Version=v4.5" framework. This is a higher versi
on than the currently targeted framework ".NETFramework,Version=v4.0".
  e:\CI\CorpAppSource_Timesheet\FADV.IMS\Timesheet\App_Code\TimeSheetService.cs
(372): warning CS0108: 'TimeSheetService.oSecurityRoot' hides inherited member
'IMSUserPermission.oSecurityRoot'. Use the new keyword if hiding was intended.
[E:\CI\CorpAppSource_Timesheet\Timesheet.metaproj]
  e:\CI\CorpAppSource_Timesheet\FADV.IMS\Timesheet\App_Code\TimeSheetService.cs
(383): warning CS0108: 'TimeSheetService.oSystemRoot' hides inherited member 'I
MSUserPermission.oSystemRoot'. Use the new keyword if hiding was intended. [E:\
CI\CorpAppSource_Timesheet\Timesheet.metaproj]
  e:\CI\CorpAppSource_Timesheet\FADV.IMS\Timesheet\UserControls\ParentObjectMen
uUC.ascx.cs(744): warning CS0618: 'System.Xml.XmlDataDocument' is obsolete: 'Xm
lDataDocument class will be removed in a future release.' [E:\CI\CorpAppSource_
Timesheet\Timesheet.metaproj]

    4 Warning(s)
    0 Error(s)

Time Elapsed 00:00:12.83
Naresh G
  • 1
  • 1
  • What is your expected behavior that is not happening? Is it that not all the dlls are being copied over? does the site work after publishing it or are you seeing errors/warnings when navigating there as well? – Bassie Jan 09 '17 at 14:16
  • I am expecting all the binaries to be published under E:\Naresh, but i see only few DLL's being copied and the rest are not to be seen in the directory. – Naresh G Jan 10 '17 at 08:24
  • @NareshG What's the detail log after specifying /v:d argument? – starian chen-MSFT Jan 16 '17 at 06:52

2 Answers2

0

You need to set DeployOnBuild=true instead of false, after that the web application projects will be published to E:\Naresh\ _PublishedWebsites folder.

On the other hand, you need to specify website.publishproj (web site root folder) for msbuild.exe to publish web site project individually if there is website project included in the solution. More information, you can refer to this thread:

How to use command line msbuild to deploy VS2012 Web Site project without precompiling it

Community
  • 1
  • 1
starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53
  • Yes i had tried to set the DeployOnBuild=true as well but dint workout. When i mentioned that i was building each project individually, what i did was to remove the rest of the projects using solution explorer from Visual studio and saved it. This way i was able to build projects individually.... – Naresh G Jan 10 '17 at 08:24
  • @NareshG What's the result if you try it with a new solution with some projects? What's the type of your projects (web site or web application)? What's the detail log (the log you provided do not include publish information)? Can you share the sample solution on the OneDrive, which can reproduce that issue? – starian chen-MSFT Jan 10 '17 at 09:13
  • When i try with other project i see all DLL's and _PublishedWebsites getting created under which there are binaries getting created which can be deployed. – Naresh G Jan 10 '17 at 09:48
  • @NareshG So, just a solution has the issue? What's the detail log of msbuild command line? – starian chen-MSFT Jan 10 '17 at 09:56
  • i have pasted the detailed o/p after executing the MSbuild cmd which is there in as part of the question asked. and 4 warnings which is shown as part of the execution – Naresh G Jan 10 '17 at 10:27
  • @NareshG What're types of these projects (e.g. web application, class library)? Are that solution upgraded from earlier version? – starian chen-MSFT Jan 10 '17 at 10:42
  • its a web application referenced by DLL's solution wasn't upgraded anytime before.. – Naresh G Jan 11 '17 at 12:06
  • @NareshG Try to add /v:d or /v:diag to msbuild command to get detailed log, then post the detail log here. – starian chen-MSFT Jan 12 '17 at 02:08
  • not able to share the detailed output log after adding /v:diag to msbuild command as it's exceeding the character limit – Naresh G Jan 17 '17 at 08:28
  • @NareshG What do you mean character limit? Current thread character limit that you can add to your question? You can share it on the OneDrive (zip file) – starian chen-MSFT Jan 17 '17 at 08:32
0

You can create a custom build action under

Properties -> Build Events -> Post-build event command line.

Here just write a simple batch command to copy the missing dlls from yuor project folder to the target output directory.

You may find it useful to select Edit Post-Build... and see what macros are available to help you write a generic command. You can also add your own if required.

Hope this helps

Bassie
  • 9,529
  • 8
  • 68
  • 159