当前位置:网站首页>Visual studio 2019 cannot run azure functions locally

Visual studio 2019 cannot run azure functions locally

2021-06-21 21:16:30 Tianya blue

Last project , Need to maintain code written by colleagues , It's mainly a bunch based on .net core 3.1 Of Azure Functions. Think of 2 The first contact was made years ago Azure Functions( It was based on .net framework), It's a bad start , The code never works . Tried a variety of online solutions , For days , At the end of the day visual studio 2017 Unload and reload , To solve the problem , I don't know what will happen this time .

Good! , First clone the code locally ,Visual Studio 2019 Open the solution , Set up Azure Functions The project is the start item , function , And then you see the death progress bar start its performance

When the day lily is cold , See the following “ Reload alert ” Warning , It's the same result after repeated running for several times , I want to die ... Microsoft technology , How to put it? ,.net core It's all in the third edition , It's still like this ...

What do I do ? Let's try to find a solution without reloading first ! No, Google Use, of course Bing Search for , After all, it's the Microsoft technology stack , Manually enter the error message , The first result comes from StackOverflow, The answer marked with the best answer is : reinstall ! reinstall !! reinstall !!! Let me slowly ...

I took a closer look at that “ Reload alert ” Warning , Follow the folder all the way down , Something strange happened : ..\Releases\3.23.5 It's an empty folder ,..\Releases\3.23.4 It's not called cli_x64 Folder , however cli Under the folder is a file named func.exe The executable file of

therefore : yes Visual Studio 2019 Of Azure Functions The configuration items read by the project template runtime and the latest Azure Function CLI Problems caused by configuration mismatch ? Try to ..\Releases\3.23.4 A new one named cli_x64 Folder , And put cli A copy of the file in the folder is copied to cli_x64 Next ( Copy instead of renaming the folder directly , In order not to destroy the default program installation directory structure , Cause potential problems when developing other projects ), function , The death progress bar appears again , After a while , Pop up CMD Command line window , The program has run miraculously !!!

Azure Functions Core Tools
Core Tools Version:       3.0.3442 Commit hash: 6bfab24b2743f8421475d996402c398d2fe4a9e0  (32-bit)
Function Runtime Version: 3.0.15417.0

[2021-06-20T11:23:16.149Z] Found C:\..\..\XXXXX.Functions.csproj. Using for user secrets file configuration.

Functions:

        Version: [GET] http://localhost:7072/api/version

        ................................................

So here are all the problems solved ? It doesn't seem that ! I found that every time I stop and restart, there will be a download pop-up , It's not reasonable ... Take a look at the solution you just found , Logically speaking ..\Releases\3.23.5 It shouldn't be an empty folder , May be the network speed is not good, did not download the completion of it ! Or part of the configuration mismatch above ? After all , Development Visual Studio and Development Azure Functions CLI Maybe it's not a team .

that , hold ..\Releases\3.23.4 Copy all the files under to ..\Releases\3.23.5 Try next ? Search online to confirm , It's still coming from the water StackOverflow, Sure enough , Great minds think alike , But there's a little detail to pay attention to , To modify the configuration file manifest-XXXXXX.json Version information in ( Pay attention to replace the whole ,vs code It's really fragrant 🥰)~~

Okay , Stop debugging every time and run again , Finally, I don't have to face the death bar anymore ...

At the end : In fact, solving this problem is not as troublesome as described above , After all, I've been working for some years , A few more words , More detailed and vivid record of thinking process , There's always some use , To prevent climbing , Enclosed Original address , Now people who want to get something for nothing / Too many websites , Although this essay is quite watery ...

版权声明
本文为[Tianya blue]所创,转载请带上原文链接,感谢
https://chowdera.com/2021/06/20210621210506630l.html