Visual Studio 2022 and .net update issues for Azure Function App - azure

I have been using Visual Studio 2019 for my Azure Function App. I recently updated to version 2022, I then uninstalled 2019.
I am getting the following errors now:
1>CodeaApi -> G:\AVR_Project\Codea App\Codea Azure Function App\bin\Debug\netcoreapp3.1\bin\CodeaApi.dll
1>C:\Users\asf\.nuget\packages\microsoft.net.sdk.functions\3.0.6\build\Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : It was not possible to find any compatible framework version
1>C:\Users\asf\.nuget\packages\microsoft.net.sdk.functions\3.0.6\build\Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : The framework 'Microsoft.NETCore.App', version '3.0.0' (x64) was not found.
1>C:\Users\asf\.nuget\packages\microsoft.net.sdk.functions\3.0.6\build\Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : - The following frameworks were found:
1>C:\Users\asf\.nuget\packages\microsoft.net.sdk.functions\3.0.6\build\Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : 6.0.1 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
1>C:\Users\asf\.nuget\packages\microsoft.net.sdk.functions\3.0.6\build\Microsoft.NET.Sdk.Functions.Build.targets(41,5): error :
1>C:\Users\asf\.nuget\packages\microsoft.net.sdk.functions\3.0.6\build\Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : You can resolve the problem by installing the specified framework and/or SDK.
1>C:\Users\asf\.nuget\packages\microsoft.net.sdk.functions\3.0.6\build\Microsoft.NET.Sdk.Functions.Build.targets(41,5): error :
1>C:\Users\asf\.nuget\packages\microsoft.net.sdk.functions\3.0.6\build\Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : The specified framework can be found at:
1>C:\Users\asf\.nuget\packages\microsoft.net.sdk.functions\3.0.6\build\Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=3.0.0&arch=x64&rid=win10-x64
1>C:\Users\asf\.nuget\packages\microsoft.net.sdk.functions\3.0.6\build\Microsoft.NET.Sdk.Functions.Build.targets(41,5): error :
1>C:\Users\asf\.nuget\packages\microsoft.net.sdk.functions\3.0.6\build\Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : Metadata generation failed.
1>Done building project "CodeaApi.csproj" -- FAILED.
Do I need to install version 3.0.1 to make it compatible with Azure Function Apps?

Yes you can resolve this by installing .NET Core 3.1 SDK,
When targeting Azure Functions 3.0, by default, the .NET Core 3.1 SDK
is required on the machine building the project.

Related

Bot Framework Composer - failed

I'm trying to build a chatbot and when I click on start bot I get an error.
Error occurred building the bot
It was not possible to find any compatible framework version The
framework 'Microsoft.AspNetCore.App', version '3.1.0' was not found. -
The following frameworks were found: 5.0.7 at [C:\Program
Files\dotnet\shared\Microsoft.AspNetCore.App] You can resolve the
problem by installing the specified framework and/or SDK. The
specified framework can be found at: -
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&framework_version=3.1.0&arch=x64&rid=win10-x64
I have all of these installed:
How can I go about resolving this?
Just download the 3.1.o version also and it should work.

Azure DevOps build of Xamarin.iOS project fails - MTOUCH : error MT2002: Failed to resolve "System.Drawing.Color" reference

I have a build issue with a Xamarin.iOS app in Azure DevOps that I haven't been able to solve. I'm wondering if anyone has any suggestions.
Building the iOS version of the app works locally in VS for Mac but fails in Azure due to this error:
MTOUCH : error MT2002: Failed to resolve "System.Drawing.Color" reference from "System.Drawing.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" [/Users/runner/runners/2.164.6/work/1/s/iOS/CatRentalStore.iOS.csproj]
I was having a similar issue with the Android build. I resolved it by switching from the macOS-10.14 hosted build agent to the windows-2019 agent, but that isn't an option with the iOS app.
I've updated packages that may use System.Drawing.Color to the latest stable releases - Acr.UserDialogs, BTProgressHUD, Splat, and Xamarin.Essentials.
I searched the solution source and did not find any direct references to the System.Drawing.Color class.
I also tried specifying the version of Xamarin/Mono to use in the build to match my local version using sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 6_4_0. That caused a different error to occur:
error MSB4018: The "GenerateDepsFile" task failed unexpectedly.
error MSB4018: System.MissingMethodException: Method not found: System.Collections.Generic.IList`1<NuGet.Packaging.Core.PackageDependency> NuGet.ProjectModel.LockFileTargetLibrary.get_Dependencies()
References to this issue:
https://github.com/mono/mono/issues/13483
https://github.com/xamarin/xamarin-macios/pull/6011
https://github.com/aritchie/userdialogs/issues/654
https://github.com/reactiveui/splat/issues/204
According to this document:
NET Core 2.2.105 is default on VM images but Mono version 6.0 or greater requires .NET Core 2.2.300+. If you use the Mono 6.0 or greater, you will have to override .NET Core version using .NET Core Tool Installer task. If you use 6.4.0, you need to install at least 2.2.300+ .net core.
I had the same problem. Visual Studio sometimes failed to update the reference during the NuGet package upgrade:
These steps helped me resolve my issue (iOS project):
Check every reference and see if it matches the version of the corresponding NuGet package
Check the path/version of the referenced assembly:
Make sure that it matches your installed package version:
If the versions do not match: downgrade the corresponding NuGet package and then upgrade the same NuGet package again and check if the version now matches
I did that procedure one NuGet package at a time. After ensuring that all versions match the build succeeded.
On my dev machine, the older versions were still present in the packages folder. Therefore the build always worked on my machine but not on the build server.

Azure .Net core with sql internal server error

I am following microsoft documentation to deploy .Net core with sql. when I go to my website the following is displayed:
An error occurred while starting the application. .NET Core X86
v4.1.1.0 | Microsoft.AspNetCore.Hosting version 1.1.2 |
Microsoft Windows 10.0.14393 | Need help?
When I run the app on local machine there are no errors and I am able to add toDo Items.
In my CsProj file:
<TargetFramework>netcoreapp1.1</TargetFramework>
I have seen other people with similar issue discuss a global.json file, but i do not see any and am not sure if I should create one and what exactly to put in it.
Possibly Related info:
When I push to azure in command line I get this error:
warning NU1701: Package 'Microsoft.Composition 1.0.27' was restored
using '.NETPortable,Version=v0.0,Profile=Profile259' instead of the
project target framework '.NETCoreApp,Version=v1.1'. This package may
not be fully compatible with your project. remote: Restore completed
in 269.7 ms for D:\home\site\repository\DotNetCoreSqlDb.csproj.
the deployment is successful though.
You could try to add the below to the <PropertyGroup> element in your DotNetCoreSqlDb.csproj
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
This is because the Microsoft.Composition 1.0.27 is an old nuget package which does not compatible with the your project target framework which is .NET Core 1.1.
The supported framework for the Microsoft.Composition 1.0.27 is as below:
Supported Platforms:
.NET Framework 4.5
Windows 8
Windows Phone 8.1
Windows Phone Silverlight 8
Portable Class Libraries
Reference: Package Microsoft.Composition 1.0.27 is not compatible with netcoreapp1.1

Why can't I create a .NET Core/Standard 2.0 project?

I've installed the .NET Core 2.0 SDK from https://www.microsoft.com/net/core. If I run dotnet new classlib --framework netstandard2.0 I get the following output:
Error: Invalid values for parameter(s) [--framework] for template Class library.
Options:
-f|--framework
netcoreapp1.0 - Target netcoreapp1.0
netcoreapp1.1 - Target netcoreapp1.1
netstandard1.0 - Target netstandard1.0
netstandard1.1 - Target netstandard1.1
netstandard1.2 - Target netstandard1.2
netstandard1.3 - Target netstandard1.3
netstandard1.4 - Target netstandard1.4
netstandard1.5 - Target netstandard1.5
netstandard1.6 - Target netstandard1.6
Configured Value: netstandard2.0
Default: netstandard1.4
If I omit the --framework parameter it creates a .NET Standard 1.4 app; I can then change the target framework manually to netstandard2.0 and build it with no problems.
In Visual Studio 2017.4 the project properties page displays blank against the target framework.
Running dotnet --info produces the following:
.NET Command Line Tools (1.0.4)
Product Information:
Version: 1.0.4
Commit SHA-1 hash: af1e6684fd
Runtime Environment:
OS Name: Windows
OS Version: 10.0.15063
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.4
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
Does this mean I need to update my CLI tools, and if so how? I thought they were included in the SDK. And how do I get Visual Studio to understand about 2.0?
Worked this out in the end: I had an old global.json file in my root code directory that referenced version 1.0.0-rc1-final. Deleting this enabled the 2.0 tooling.

Getting error with SDK on Visual Studio 2012

I am trying to make a windows 8 application using Visual Studio 2012. Its an RSS reader and i am using Split App - Javascript template. When i build the app i am getting this warning :
Warning : DEP0810 : This app references Microsoft.WinJS.1.0, version 1.0.8514.0, found in your SDK, but you have a higher version of Microsoft.WinJS.1.0 installed on the target machine, 1.0.9200.20602. If you continue to run this application, it will run against the currently installed version, Microsoft.WinJS.1.0, version 1.0.9200.20602. Consider updating your SDK to match the version of Microsoft.WinJS.1.0 that is installed.
I don't know how to update the SDK.
Any help is appreciated.
Try downloading the latest version of the 'Visual Studio 2012 Extensions for the Windows Library for JavaScript', below:
http://www.microsoft.com/en-us/download/details.aspx?id=30687
I had a similar problem with Visual Studio 2013 and MS WinJS.2.0 which I updated from the following web address which resolved the problem:
http://www.microsoft.com/en-gb/download/details.aspx?id=40793

Resources