question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CLI: Function compilation error (C#)

See original GitHub issue

Hi 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:closed
  • Created 7 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lindydonnacommented, Nov 29, 2016

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:

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "connection string value"
  }
}
0reactions
lindydonnacommented, Dec 21, 2016

Closing issue, please reopen if the issue persists

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found