I am upgrading v2 .netcore functions to v3-preview functions based on @jeffhollan https://dev.to/azure/develop-azure-functions-using-net-core-3-0-gcm description
I do have v3 templates in VS (with the suggested environment variable). My csproj:
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<AzureFunctionsVersion>v3-preview</AzureFunctionsVersion>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="2.0.0-beta3" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventHubs" Version="3.0.6" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.30-beta2" />
...
hosts.json:
"version": "2.0"
I have multiple functions in the project. When I start the solution (local debug), I get an exception:
System.IO.FileNotFoundException: 'Could not find file 'C:\Users[userId]\source\repos\IotProcessor\HubProcessor\bin\Debug\netcoreapp3.0\bin\function.json'.'
While it is under
'C:\Users[userId]\source\repos\IotProcessor\HubProcessor\bin\Debug\netcoreapp3.0\ functionName1 \function.json'.'
Stacktrace
at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks)
at System.IO.File.InternalReadAllText(String path, Encoding encoding)
at System.IO.File.ReadAllText(String path)
at System.IO.Abstractions.FileWrapper.ReadAllText(String path)
at Microsoft.Azure.WebJobs.Script.Utility.TryReadFunctionConfig(String scriptDir, String& json, IFileSystem fileSystem) in C:\azure-functions-host\src\WebJobs.Script\Utility.cs:line 440
cc @brettsam
Assigning to @soninaren for further investigation
Workaround:
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.0-preview2" />)@TimPosey2 - You're a lifesaver, worked like a charm.
Most helpful comment
Workaround:
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.0-preview2" />)