简体   繁体   English

在 Visual Studio Code 上运行 .NET Core Azure 函数时出现问题。 未定义或导入预定义类型“System.Object”

[英]Problem running .NET Core Azure functions on Visual Studio Code. Predefined type 'System.Object' is not defined or imported

I am getting following error in visual studio code while running brand new Azure function project created newly.在运行新创建的全新 Azure function 项目时,我在 Visual Studio 代码中遇到以下错误。

It's roughly about .NET Core Sdk and all other errors seems to be relate with that.大约是 .NET Core Sdk ,所有其他错误似乎都与此有关。 Can somebody help me to get rid from them.有人可以帮我摆脱他们。

I already tested all other links but my problem is not related with the any of the described issues.我已经测试了所有其他链接,但我的问题与所描述的任何问题都无关。 在此处输入图像描述

CSProjFile CSProj文件

在此处输入图像描述

在此处输入图像描述 在此处输入图像描述 虽然做

As I have.Net SDK 6.0.100 along with 6.0.101 as you can see below:正如我所拥有的.Net SDK 6.0.1006.0.101一样,如下所示:

在此处输入图像描述

And Created the Azure Functions of Stack .Net 6.0 Http Trigger Function through Visual Studio Code, it is running successfully.并通过Visual Studio Code创建了Stack .Net 6.0 Http Trigger FunctionAzure函数,运行成功。

在此处输入图像描述

Here is my .csproj file:这是我的.csproj文件:

在此处输入图像描述

As I believe that you're missing the SDK Package Reference in the ItemGroup of your .csproj file:我相信您在.csproj文件的 ItemGroup 中缺少SDK Package Reference

<PackageReference  Include="Microsoft.NET.Sdk.Functions"  Version="4.0.1"  />

Include it in the .csproj file and check running the function.将其包含在.csproj文件中并检查运行 function。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 预定义类型“System.Object”未定义或导入 .net 4.6 - Predefined type 'System.Object' is not defined or imported .net 4.6 未定义或导入预定义类型System.Object - Predefined type System.Object is not defined or imported 未定义或导入预定义类型“System.Object/String” - Predefined type 'System.Object/String' is not defined or imported C# 未定义或导入预定义类型“System.Object” - C# Predefined type 'System.Object' is not defined or imported Dotnet Core 3.1 和 CSC:未定义或导入预定义类型“System.Object” - Dotnet Core 3.1 & CSC: Predefined type 'System.Object' is not defined or imported “预定义类型'系统。*'未定义或导入”错误,visual studio代码,omnisharp - “Predefined type 'System.*' is not defined or imported” Error, visual studio code, omnisharp .NET Xsl脚本转换结果未定义或导入“System.Object” - .NET Xsl script transform results in 'System.Object' is not defined or imported Protobuf网络未告知要序列化System.Object,但仍会收到错误:没有为以下类型定义序列化程序:System.Object - Protobuf net not told to Serialize a System.Object but still get error: No serializer defined for type: System.Object ProtoBuf-Net:没有为类型定义序列化程序:System.Object - ProtoBuf-Net: No serializer defined for type: System.Object 尝试在 Visual Studio 2017 中为 Unity 2D 编译 c# 脚本时出现“未定义或导入预定义类型 System.Void”错误 - "Predefined type System.Void is not defined or imported" error trying to compile c# scripts for Unity 2D in Visual Studio 2017
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM