Library/Static Method not Updating in Azure

2019-09-16 22:29发布

I wrote a static method in an MVC (WebApi) website. The static method had a bug in it, so I changed the logic in the static method. The method now works on my local machine and returns the correct data.

However, Azure is STILL running the old method and returning the incorrect results. The only thing I could do was compile the library locally and FTP it up to Azure.

Why is the old static method being retained - even AFTER a build and deployment?

NOTE: I'm doing manual build/deployments from Visual Studio Online/TFS (I'm not deploying from Visual Studio). I do have Rebuild and Clean flags set on MSBUILD.

UPDATE: After looking at file sizes, apparently Azure is deploying an older version of the DLL as the DLL that's deployed is much larger than the one I'm compiling locally.

3条回答
Explosion°爆炸
2楼-- · 2019-09-16 22:50

Is that new dll included in the file list you can see in preview just before you publish to your website? What are your publish options for the dll?

I assume you are using Azure Websites? Is that correct?

查看更多
甜甜的少女心
3楼-- · 2019-09-16 22:56

I'd just deploy to another Website instance, test as working using the default domain and if it all looks good redirect DNS and delete the old site.

查看更多
萌系小妹纸
4楼-- · 2019-09-16 23:00

Arggghhh!!!

After 2 days of troubleshooting, I finally figured it out.

Again, the local DLL was different than Azure's DLL in size. So I started thinking that they may be a problem w/ the file in Visual Studio Online.

So, I opened up another VM and connected to VSO to look at the source explorer. Sure enough, the file in VSO was the old version. Apparently, Visual Studio marked the file locally as being up-to-date so it wasn't being checked in with any new changes.

To fix:

  1. Do an exclusive checkout of the file in Visual Studio
  2. Then, attempt a check in
  3. You should then, finally(!!!), get a merge error
  4. Merge the local file with the file in the repository
  5. Check the file back into VSO.

It's finally deploying correctly again.

查看更多
登录 后发表回答