Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] IFormFile in c# scripting #5397

Open
guidoDimasi opened this issue May 16, 2024 · 1 comment
Open

[BUG] IFormFile in c# scripting #5397

guidoDimasi opened this issue May 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@guidoDimasi
Copy link

guidoDimasi commented May 16, 2024

Description

seems ipossible to work with IFormFIle inside a c# scipting activity

Steps to Reproduce

  1. create a workflow with the designer
  2. add an http endpoint that accept formfile and it stores insiede a variable
  3. add a c# scriptting activities that have this code inside:

##error
error CS0234: namespace 'AspNetCore' doesnt exisit insiede'Microsoft'...

##stack trace
at Microsoft.CodeAnalysis.Scripting.ScriptBuilder.ThrowIfAnyCompilationErrors(DiagnosticBag diagnostics, DiagnosticFormatter formatter)
at Microsoft.CodeAnalysis.Scripting.ScriptBuilder.CreateExecutor[T](ScriptCompiler compiler, Compilation compilation, Boolean emitDebugInformation, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Scripting.Script1.GetExecutor(CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Scripting.Script1.CommonGetExecutor(CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Scripting.Script1.TryGetPrecedingExecutors(Script lastExecutedScriptInChainOpt, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Scripting.Script1.GetPrecedingExecutors(CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Scripting.Script1.RunAsync(Object globals, Func2 catchException, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Scripting.Script1.RunAsync(Object globals, CancellationToken cancellationToken) at Elsa.CSharp.Services.CSharpEvaluator.EvaluateAsync(String expression, Type returnType, ExpressionExecutionContext context, ExpressionEvaluatorOptions options, Func2 configureScriptOptions, Func`2 configureScript, CancellationToken cancellationToken)
at Elsa.CSharp.Extensions.CSharpEvaluatorExtensions.EvaluateAsync(ICSharpEvaluator evaluator, String expression, Type returnType, ExpressionExecutionContext context, ExpressionEvaluatorOptions options, CancellationToken cancellationToken)
at Elsa.CSharp.Activities.RunCSharp.ExecuteAsync(ActivityExecutionContext context)
at Elsa.Workflows.Activity.Elsa.Workflows.Contracts.IActivity.ExecuteAsync(ActivityExecutionContext context)
at Elsa.Workflows.Middleware.Activities.DefaultActivityInvokerMiddleware.ExecuteActivityAsync(ActivityExecutionContext context)
at Elsa.Workflows.Runtime.Middleware.Activities.BackgroundActivityInvokerMiddleware.ExecuteActivityAsync(ActivityExecutionContext context)
at Elsa.Workflows.Middleware.Activities.DefaultActivityInvokerMiddleware.InvokeAsync(ActivityExecutionContext context)
at Elsa.Workflows.Middleware.Activities.NotificationPublishingMiddleware.InvokeAsync(ActivityExecutionContext context)
at Elsa.Workflows.Middleware.Activities.ExecutionLogMiddleware.InvokeAsync(ActivityExecutionContext context)

file.json

@guidoDimasi guidoDimasi added the bug Something isn't working label May 16, 2024
Copy link

glime-ai bot commented May 16, 2024

Based on the error message "error CS0234: namespace 'AspNetCore' doesn't exist inside 'Microsoft'...", it seems like there might be a missing reference to the Microsoft.AspNetCore namespace in your project. This namespace is part of the ASP.NET Core framework and is required for working with many ASP.NET Core features, including handling form files.

To resolve this issue, you should ensure that your project references the appropriate ASP.NET Core libraries. If you are using .NET Core 3.1 or later, these libraries are usually included by default. However, if they are missing or if you are using a different version of .NET, you may need to add the necessary package references manually.

Here are some steps you can take to troubleshoot and resolve the issue:

  1. Check your project file (.csproj) to ensure that it includes a reference to the Microsoft.AspNetCore.App framework or the specific Microsoft.AspNetCore NuGet packages required for your project.

  2. If the references are missing, you can add them by editing the project file or using the NuGet package manager in your development environment.

  3. After adding the necessary references, rebuild your project to see if the error is resolved.

  4. If you continue to experience issues, you may need to check the version compatibility between your project and the ASP.NET Core libraries you are trying to use.

  5. Ensure that your C# scripting activities are correctly referencing the required namespaces and that the environment where the script is executed has access to those namespaces.

If you are still facing issues after following these steps, you may want to seek further assistance on platforms like Stack Overflow or the official Elsa Workflows GitHub repository, where you can ask questions and get help from the community.

This comment was generated by Glime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant