Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the kudu script to use msbuild command to publish just the web project in the solution #2111

Closed
vijayrkn opened this issue Aug 25, 2016 · 5 comments
Assignees

Comments

@vijayrkn
Copy link

vijayrkn commented Aug 25, 2016

Replace this

:: 2. Build and publish 
call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\AspNetCoreVS.sln" /nologo /verbosity:m /p:deployOnBuild=True;AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false;publishUrl="%DEPLOYMENT_TEMP%" %SCM_BUILD_ARGS%

with

:: 2. Build
call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\AspNetCoreVS.sln" /nologo /verbosity:m /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false" %SCM_BUILD_ARGS%
-------------
:: 3. Publish
call :ExecuteCmd "%MSBUILD_PATH%" "/AspNetCoreVS.xproj" /nologo /verbosity:m /t:GatherAllFilesToPublish /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false;PublishOutputPathNoTrailingSlash="%DEPLOYMENT_TEMP%" %SCM_BUILD_ARGS%
@watashiSHUN
Copy link
Contributor

How can I figure out which .xproj file to pass to msbuild?
and how does msbuild find the .xproj file since you are only passing the relative filepath

@vijayrkn
Copy link
Author

Ahmed had mentioned that this is how Kudu identifies the webproject from the solution.

We publish the web xproj file and expect to only be one when we’re auto discovering. The way we do that is by looking for an xproj project with a web.config file.

Regarding the path, it needs to be the relative path to the web xproj file.

@watashiSHUN
Copy link
Contributor

what version of msbuild is being used? I am testing with the following deployment script:

:: 2. Build
call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\AspNetCoreRC2.sln" /nologo /verbosity:m /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false %SCM_BUILD_ARGS%
IF !ERRORLEVEL! NEQ 0 goto error

:: 3. Publish
call :ExecuteCmd "%MSBUILD_PATH%" "/AspNetCoreRC2.xproj" /nologo /verbosity:m /t:GatherAllFilesToPublish /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false;PublishOutputPathNoTrailingSlash="%DEPLOYMENT_TEMP%" %SCM_BUILD_ARGS%
IF !ERRORLEVEL! NEQ 0 goto error

but I got an error

remote: MSBUILD : error MSB1001: Unknown switch.
remote: Switch: /AspNetCoreRC2.xproj

it looks like MSbuild only takes .sln or .proj file from the DOC

@vijayrkn
Copy link
Author

"%MSBUILD_PATH%" "/AspNetCoreVS.xproj"
This '"/AspNetCoreVS.xproj"' was just an example, the xproj path needs to be replaced with the xproj that needs to be published.

@watashiSHUN
Copy link
Contributor

@vijayrkn the new Kudu is out, please give it a try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants