dotnet publish Not Deploying

1.2k Views Asked by At

I am trying to execute a Web Deploy on my .NET Core 2.0 Project. Deploying manually from within Visual Studio's "Publish" feature works fine.

From the command line, I am executing:

dotnet publish TechsportiseOnline/TechsportiseOnline.csproj -c Release /p:PublishProfile="Properties\PublishProfiles\techsportise.com - Web Deploy" /p:Username="***" /p:Password="***"

The command comes back as successful, with no errors at all - even with verbosity set to Diagnostic. For all intents and purposes, Visual Studio thinks its been a success.

However when I visit the website, the change I have made is very clearly not there. I have tried visiting Incognito and clearing cache and the change simply is not deployed.

I have tried the same command using dotnet build /p:DeployOnBuild=true and I have also tried specifying all the parameters manually

dotnet build TechsportiseOnline/TechsportiseOnline.csproj -c Release /p:DeployOnBuild=true /p:DeployIisPath="techsportise.com" /p:MSDeployServiceURL="***" /p:Username="***" /p:Password="***" /p:SkipExtraFilesOnServer=true /p:AllowUntrustedCertificate=true

I don't think its a local system issue as I am getting the same issue using Bitbucket Pipelines - reporting success even though no changes are visible post-deploy. I don't think it's a server issue as it works when manually executing Publish inside VS.

Any ideas?

3

There are 3 best solutions below

0
kevin On

You are looking for changes using the web browser. Instead verify the files have changed. I am assuming they have and your issue it the browser is caching the website. Try refreshing with ctr + F5 or try clearing the browser data.

0
Shreeram On

Either you are executing the command from a different folder which has the same project files or you have some Cache issues. Try Ctrl+shift+delete on your browser and clear everything or open a new Incognito window and try again.

0
Poat On

This is an old thread - but I found there is a bug w/ dotnet publish when using CLI.

It'll ignore the PublishUrl and publish locally (can view from the logs pretty easily)

To get around - you can manually add PublishDir then it'll work from the CLI

https://github.com/dotnet/sdk/issues/12490