Mary
Mary

Reputation: 194

File updated deployed, new file ignored

I create a web project with Visual Studio. I use GitHub desktop app to push my code to my Github I create an Azure DevOps project throught the Azure portal to create a CI and don't change anything

When I commit a change all the CI run, the build is done with success and a new deployment is done.

To be sure everything work I did 2 differents tests

First : I created a new HTML file in my project with the other HTML files. When I commit, build and deployment run on Azure Devops without error, but I cannot see my new file in the wwwroot folder

Second : I updated a existing HTML file. When I commit, build and deployment run on Azure Devops without error, and I can see my update on the file present on the web app.

Why this difference ? I would like understood why update work correctly but not the add. I don't know where start to troubleshoot the issue

Upvotes: 0

Views: 932

Answers (3)

Jon Koeter
Jon Koeter

Reputation: 1094

For anyone googling this: I had this problem with a JS file, same deal.

Somehow this line ended up in my CSProj file:

  <ItemGroup>
    <Content Remove="wwwroot\lib\mylibs\pages\mylibs.employee.js" />
  </ItemGroup>

Once I removed it, everything worked fine.

Upvotes: 0

Manoj Kankere
Manoj Kankere

Reputation: 11

Because when you commit your code to DevOps you should commit yourprojectname.csproj file as well

Upvotes: 1

Md. Shariful Siddique
Md. Shariful Siddique

Reputation: 367

Could you please check the "build action" of the new .cshtml file?

In visual studio, right click on the file and go to properties. Check if the build action is set to "Content", if not set it to content and commit.

Other build actions sometimes will not show any error but the view file will not be copied upon build. This is not Azure DevOps issue, rather visual studio filetype issue.

Let me know if this was the case. Good luck :)

Upvotes: 0

Related Questions