none
MSBuild doesn't take PublishProfile without precompile

    Question

  • I have legacy web site application, which throws a lot of circular reference error, if I precompile it. So decided not to precompile before publish and made a PublishProfile named AUTO_BUILD with Precompile option unchecked.
    Publish from IDE of VS2012/2017 premium is working fine, but not with below command. Still getting circular reference error even after providing PublishProfile attribute to MSBuild.

    Anything wrong with this command?
    C:\Windows\Microsoft.NET\Framework\v4.0.30319>MSBuild  <solutionfilepath>  /p:DeployOnBuild=true /p:PublishProfile=AUTO_BUILD>C:\buildlog.txt

    even same for
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin>MSBuild  <solutionfilepath>  /p:DeployOnBuild=true /p:PublishProfile=AUTO_BUILD">C:\buildlog.txt


    • Edited by BHDave Monday, December 04, 2017 6:41 AM
    Monday, December 04, 2017 6:32 AM

Answers

  • Hi BHDave,

    Thanks for posting here.

    Since the type of project you are deploying is website. The publish process of website project is not plumbed into the build process. When you create a publish profile in VS the following are created:

    1) A publish profile (.pubxml file) under App_Data/PublishProfiles.

    2) A website.publishproj in the root of the website.

    The purpose of the website.publishproj is to facilitate command line publishing. So publish file should be website.publishproj rather than WebSite1.sln file. So please try to publish your website with the file website.publishproj:

    msbuild.exe "website.publishproj" /p:DeployOnBuild=true /p:PublishProfile=AUTO_BUILD">C:\buildlog.txt

    If this not resolve this issue, please share your build log to me.

    Hope this help you.


    MSDN Community Support Please remember to click Mark as Answer. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Monday, December 04, 2017 9:24 AM