Fail in Publishing

Vincent Zhang 0 Reputation points
2024-05-28T22:21:46.84+00:00

I have followed the instructions on this page, and created a Function App in Azure successfully, but when I publish it, I received the following error:

Severity Code Description Project File Line Suppression State Error Unable to resolve 'runtime.any.System.Runtime (>= 4.1.0)' for 'net8.0/win-x64'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, Microsoft Visual Studio Offline Packages, nuget.org. FunctionAppDotNet8Test C:\FunctionAppDotNet8\FunctionAppDotNet8Test\FunctionAppDotNet8Test\FunctionAppDotNet8Test.csproj 0 Error Unable to resolve 'runtime.any.System.IO (>= 4.1.0)' for 'net8.0/win-x64'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, Microsoft Visual Studio Offline Packages, nuget.org. FunctionAppDotNet8Test C:\FunctionAppDotNet8\FunctionAppDotNet8Test\FunctionAppDotNet8Test\FunctionAppDotNet8Test.csproj 0 Error Unable to resolve 'runtime.win.System.Diagnostics.Debug (>= 4.0.11)' for 'net8.0/win-x64'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, Microsoft Visual Studio Offline Packages, nuget.org. FunctionAppDotNet8Test C:\FunctionAppDotNet8\FunctionAppDotNet8Test\FunctionAppDotNet8Test\FunctionAppDotNet8Test.csproj 0 Error Unable to resolve 'runtime.any.System.Reflection.Primitives (>= 4.0.1)' for 'net8.0/win-x64'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, Microsoft Visual Studio Offline Packages, nuget.org. FunctionAppDotNet8Test C:\FunctionAppDotNet8\FunctionAppDotNet8Test\FunctionAppDotNet8Test\FunctionAppDotNet8Test.csproj 0 Error Unable to resolve 'runtime.win.System.Runtime.Extensions (>= 4.1.0)' for 'net8.0/win-x64'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, Microsoft Visual Studio Offline Packages, nuget.org. FunctionAppDotNet8Test C:\FunctionAppDotNet8\FunctionAppDotNet8Test\FunctionAppDotNet8Test\FunctionAppDotNet8Test.csproj 0 Error Unable to resolve 'runtime.any.System.Text.Encoding (>= 4.0.11)' for 'net8.0/win-x64'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, Microsoft Visual Studio Offline Packages, nuget.org. FunctionAppDotNet8Test C:\FunctionAppDotNet8\FunctionAppDotNet8Test\FunctionAppDotNet8Test\FunctionAppDotNet8Test.csproj 0 Error Unable to resolve 'runtime.any.System.Collections (>= 4.0.11)' for 'net8.0/win-x64'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, Microsoft Visual Studio Offline Packages, nuget.org. FunctionAppDotNet8Test C:\FunctionAppDotNet8\FunctionAppDotNet8Test\FunctionAppDotNet8Test\FunctionAppDotNet8Test.csproj 0 Error Unable to resolve 'runtime.any.System.Reflection (>= 4.1.0)' for 'net8.0/win-x64'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, Microsoft Visual Studio Offline Packages, nuget.org. FunctionAppDotNet8Test C:\FunctionAppDotNet8\FunctionAppDotNet8Test\FunctionAppDotNet8Test\FunctionAppDotNet8Test.csproj 0 Error Unable to resolve 'runtime.any.System.Threading.Tasks (>= 4.0.11)' for 'net8.0/win-x64'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, Microsoft Visual Studio Offline Packages, nuget.org. FunctionAppDotNet8Test C:\FunctionAppDotNet8\FunctionAppDotNet8Test\FunctionAppDotNet8Test\FunctionAppDotNet8Test.csproj 0 Error Unable to resolve 'runtime.any.System.Globalization (>= 4.0.11)' for 'net8.0/win-x64'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, Microsoft Visual Studio Offline Packages, nuget.org. FunctionAppDotNet8Test C:\FunctionAppDotNet8\FunctionAppDotNet8Test\FunctionAppDotNet8Test\FunctionAppDotNet8Test.csproj 0 Error Unable to resolve 'runtime.any.System.Resources.ResourceManager (>= 4.0.1)' for 'net8.0/win-x64'. PackageSourceMapping is enabled, the following source(s) were not considered: C:\Program Files\dotnet\library-packs, Microsoft Visual Studio Offline Packages, nuget.org. FunctionAppDotNet8Test C:\FunctionAppDotNet8\FunctionAppDotNet8Test\FunctionAppDotNet8Test\FunctionAppDotNet8Test.csproj 0

FYI, I have installed the Azure development component with my VS 2022.

User's image

Please advise, thanks.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,516 questions
{count} votes