您好,我有一个ASP Net Core 5.0
Web API,我正尝试部署到该API,但我azure
不能,因为它说尚不支持。
但是,遵循MSDN和类似的线程(当相同的问题对于.NET Core 3.1有效时),我了解到可以选择将其发布为self-contained
。它仍然不起作用:
应用日志
VStudio发布 关于如何将应用程序发布到Azure的任何想法?
稍后编辑我忘记提及对Web API的所有调用都返回一条404
消息。
So if my [indexurl] returns the microsoft page [Indexurl]/[some path] returns 404
(which i understood from github is a 500
actually)
What should i understand ? The web api works , or it doesnt and where could the problem be ?
ASP NET Core 5.0 not supported in Azure
After testing, azure webapp currently supports ASP.NET Core 5.0.
According to your description, I conducted a test, first tested under windows, it was normal. Then deployed and tested under Linux, it is normal.
I guess the reasons may be the following two:
There is a problem with your .Net 5.0 installation. It may be used when compiling, if necessary, and cause compilation exception and release failure. (The possibility is relatively low)
默认情况下创建的webapi可能没有默认的索引页,因此您感觉不支持它。实际上,您可以使用webapp进行测试,也可以编写一个界面来进行自我测试。
我用于测试的VS2019版本是Microsoft Visual Studio Enterprise 2019 Version 16.8.2
。我在计算机上安装了.net 5.0 Runtime。
对于您的问题,请详细描述Linux下的测试步骤:
步骤1.创建Core5.0 Webapi项目。
步骤2.在本地进行测试,它可以正常工作。
步骤3.使用Deployment
模式为部署到Azure Framework-dependent
。
并对其进行测试,这看起来有点不对劲,因为该项目未设置默认路由,并且我输入WeatherForecast
来访问默认界面,它可以正常工作。
步骤4.使用Deployment
模式部署到AzureSelf-Contained
就像您的照片一样。
而且它也可以正常工作。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句