CLI: Function compilation error (C#)
See original GitHub issueHi all,
when I try to run a function (C#) with the azurefunctions CLI via func run <methodname>
that has a dependency to a third party library (i.e. ImageResizer
) I get the following error:
Reading host configuration file 'C:\Users\olarafat\repos\serverless-imagemanipulation\host.json'
Function compilation error
run.csx(1,7): error CS0246: The type or namespace name 'ImageResizer' could not be found (are you missing a using directive or an assembly reference?)
run.csx(7,24): error CS0103: The name 'ImageResizer' does not exist in the current context
run.csx(12,13): error CS0246: The type or namespace name 'ResizeSettings' could not be found (are you missing a using directive or an assembly reference?)
run.csx(12,52): error CS0103: The name 'FitMode' does not exist in the current context
run.csx(19,13): error CS0246: The type or namespace name 'ResizeSettings' could not be found (are you missing a using directive or an assembly reference?)
run.csx(19,52): error CS0103: The name 'FitMode' does not exist in the current context
The NuGet packages haven been restored via dotnet restore
.
The function works when deployed to Azure.
Repro steps
The code and configuration can be found here: https://github.com/arafato/serverless.imageresizer
Expected behavior
A locally running function.
Actual behavior
An exception (see above)
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
First time using C++/CLI and getting compiler error in class ...
I'm trying to create a wrapper class for a C# dll and am coming across a compiler error in my definition. I've tried...
Read more >Compiler Error C3821
Functions with inline assembly or setjmp cannot contain value types or managed classes. To fix this error, remove the inline assembly and ...
Read more >Compiler Error C2065
This error can occur if you're missing a closing quote after a string constant. It's an easy way to confuse the compiler. The...
Read more >How to write a good C main function
In this article, I'll explain how to structure a C file and write a C main function that handles command line arguments like...
Read more >Clang Compiler User's Manual
The Clang Compiler is an open-source compiler for the C family of programming languages, ... Require math functions to indicate errors by setting...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Btw, make sure you set a value for your connection strings in appsettings.json. Any triggers other than HTTP won’t work if you don’t have a value for
AzureWebJobsStorage
. For instance:Closing issue, please reopen if the issue persists