question

Kim Strasser avatar image
Kim Strasser asked

Can I still use my old PlayFab Azure Functions project?

I created this PlayFab Azure Functions project in 2020 and I want to know if it is necessary to change something in the project file because my project isn't working anymore when I click on start debugging and I don't know if my project is still compatible with Azure and PlayFab. I use Visual Studio Code Version 1.77.3 on a Mac.

 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <TargetFramework>netcoreapp3.1</TargetFramework>
     <AzureFunctionsVersion>v3</AzureFunctionsVersion>
   </PropertyGroup>
   <ItemGroup>
     <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.7" />
     <PackageReference Include="PlayFabAllSDK" Version="1.80.200901" />
     <PackageReference Include="PlayFabCloudScriptPlugin" Version="1.53.190627-alpha" />
   </ItemGroup>
   <ItemGroup>
     <None Update="host.json">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
     <None Update="local.settings.json">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToPublishDirectory>Never</CopyToPublishDirectory>
     </None>
   </ItemGroup>
 </Project>

MSBuild version 17.5.1+f6fdcf537 for .NET Determining projects to restore... All projects are up-to-date for restore. Myazurefunctions -> /Users/name/Myazurefunctions/bin/Debug/netcoreapp3.1/bin/Myazurefunctions.dll /Users/name/.nuget/packages/microsoft.azure.webjobs.script.extensionsmetadatagenerator/1.1.8/build/Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(37,5): warning : Failed to initialize CoreCLR, HRESULT: 0x80004005 [/Users/name/Myazurefunctions/Myazurefunctions.csproj] Debug output from extension.json generator:

/Users/name/.nuget/packages/microsoft.azure.webjobs.script.extensionsmetadatagenerator/1.1.8/build/Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(37,5): error : Metadata generation failed. Exit code: '137' Error: 'Failed to initialize CoreCLR, HRESULT: 0x80004005' [/Users/name/Myazurefunctions/Myazurefunctions.csproj]

The terminal process "dotnet 'build', '/property:GenerateFullPaths=true', '/consoleloggerparameters:NoSummary'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

I have already created a thread on github: https://github.com/microsoft/vscode/issues/180598

Can I still use my old PlayFab Azure Functions project or is it necessary to change something in the .csproj file or is it necessary to create a new project in Visual Studio Code?

CloudScript
8 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Simon Cui avatar image Simon Cui commented ·

Could you please try to uninstall and reinstall the latest Microsoft.NET.Sdk.Functions, PlayFabAllSDK and PlayFabCloudScriptPlugin? Please let us know if the issue still persists.

0 Likes 0 ·
Kim Strasser avatar image Kim Strasser Simon Cui commented ·

I have uninstalled and reinstalled Microsoft.NET.Sdk.Functions Version="4.1.3", PlayFabAllSDK Version="1.150.230403" and PlayFabCloudScriptPlugin Version="1.53.190627-alpha". But I always got this message after installing each package: 5852-bildschirmfoto-2023-04-25-um-125136.png

/Users/name/Myazurefunctions/Myazurefunctions.csproj /Users/name/.nuget/packages/microsoft.net.sdk.functions/4.1.3/build/Microsoft.NET.Sdk.Functions.targets(83,5): Error: The ExtensionsMetadataGenerator package was not imported correctly. Are you missing '/Users/name/.nuget/packages/microsoft.azure.webjobs.script.extensionsmetadatagenerator/4.0.1/build/Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets' or '/Users/name/.nuget/packages/microsoft.azure.webjobs.script.extensionsmetadatagenerator/4.0.1/build/Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.props'?

After reinstalling the packages I get some "are you missing a using directive or an assembly reference?" errors: 5861-bildschirmfoto-2023-04-25-um-130146.png

0 Likes 0 ·
Simon Cui avatar image Simon Cui Kim Strasser commented ·

Netcoreapp3.1 is not supported yet. Please try .Net 6 and rebuild your project following Quickstart: Writing a PlayFab CloudScript using Azure Functions.

0 Likes 0 ·
Kim Strasser avatar image Kim Strasser commented ·

I found out that my project is outdated and that I need to use the newer Azure Functions Core Tools version 4.x. I will try if it works with the new version.

0 Likes 0 ·
Simon Cui avatar image Simon Cui Kim Strasser commented ·

Sure, please let us know if there is any other questions.

0 Likes 0 ·
Kim Strasser avatar image Kim Strasser Simon Cui commented ·

I have created a new local project in VS Code and a new function app in Azure. But I still get this error:

/Users/name/.nuget/packages/microsoft.azure.webjobs.script.extensionsmetadatagenerator/4.0.1/build/Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(37,5): error : Metadata generation failed. Exit code: '137' Error: 'Failed to initialize CoreCLR, HRESULT: 0x80004005' [/Users/name/NewAzureFunctions/NewAzureFunctions.csproj]

I have tried to deploy the new local project to Azure but it is not working: 5857-bildschirmfoto-2023-04-27-um-134827.png

I clicked on Deploy Anyway but then I get this message: Failed to deploy path that does not exist: /Users/name/NewAzureFunctions/bin/Release/net6.0/publish

In addition, I have tried to uninstall and reinstall the following extension: 5868-bildschirmfoto-2023-04-27-um-142551.png

0 Likes 0 ·
Show more comments

1 Answer

·
Kim Strasser avatar image
Kim Strasser answered

It works now. I just needed to install .NET SDK 5.0.408: 5.0 I found the answer here: 2876

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Simon Cui avatar image Simon Cui commented ·

Glad to hear you solved it!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.