Azure / logicapps

Azure Logic Apps labs, samples, and tools
MIT License
367 stars 302 forks source link

NuGet based Logic App (Standard) does not build in Visual Studio #323

Closed gastonmuijtjens closed 2 years ago

gastonmuijtjens commented 3 years ago

I created a new single-tenant Logic App (Standard) using the Logic Apps (Standard) extension in Visual Studio Code. After that, I followed the documentation to migrate to a NuGet package-based (.NET) project.

When I try to build the project with the .NET CLI: dotnet build -c Debug and dotnet build -c Release, it builds fine.

However, when I try to build the project within Visual Studio 2019 with the Debug configuration, I'm getting the following error:

The "DebugSymbolGenerator" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Microsoft.Azure.Workflows.BuildTasks.DebugSymbolGenerator.DebugSymbolGenerator.LogMessage(String message)
   at Microsoft.Azure.Workflows.BuildTasks.DebugSymbolGenerator.DebugSymbolGenerator.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

When I try the same with the Release configuration in Visual Studio, the project builds just fine.

I attached an example solution as a .zip file that generates the above error:

TestLogicApp.zip

hongzli commented 3 years ago

Hi @gastonmuijtjens , thanks for reporting this issue. The NuGet-based project was designed to work with Visual Studio Code and dotnet/functions CLI but not Visual Studio.

Do you have a scenario that specifically requires using Visual Studio?

kaylumah commented 3 years ago

@hongzli we initially tried the NuGet-based project since our LogicApp was the ONLY project in our solution that was not part of the solution. It would allow for managing the entire project from single IDE (ie VS2019).

I could understand not being able to run it via VS2019, but not being to build a CSProj independent from IDE or tool seems like an oversight to me.

As far as I know (correct me if I am wrong here) LogicApps use the functions runtime, and C# csproj-style projects can both be run and build from VisualStudio.

Could you clarify why it would only work in VSCode?

gastonmuijtjens commented 3 years ago

@hongzli @kaylumah I would like to add that since our Logic App is part of a solution (.sln) together with other related non-Logic App projects we currently have to unload the Logic App project within Visual Studio in order to build. Also the Visual Studio build task within a Windows-agent based build pipeline in Azure DevOps would not work and requires a separate build with the dotnet cli instead.

gastonmuijtjens commented 3 years ago

@hongzli Any update on this?

hongzli commented 3 years ago

Thanks for the feedback. Unfortunately we aren't currently supporting VS development, but it is on the horizon and we will be adding support for it.

kaylumah commented 2 years ago

@hongzli do you have any timeline you can share on this? We know need to rely on a sln filter to build or project (excluding the logicapp) which is not ideal

hongzli commented 2 years ago

We still don't have a timeline for official VS support that we can share, but as a lot of users are requesting this, we will be shipping a fix for this early next year (Jan or Feb) to unblock building in VS

kaylumah commented 2 years ago

Hi @hongzli since its Feb 1st I am wondering is if you can share an update planning on this issue?

hongzli commented 2 years ago

Fix has been released, should build in VS now. Thanks for your patience

hongzli commented 2 years ago

Fix is in the latest nuget version (1.2.1) https://www.nuget.org/packages/Microsoft.Azure.Workflows.WebJobs.Extension/1.2.1