-3

I'm developing an Azure Function App locally using Azure SDK & local runtime. Along with the function App, I created a new project(class library) within the same solution because I want to share some common code between functions in same Function App. In the Class library project implemented a simple class definition with some properties. I added the class library dll to my function app project as a reference to the dependencies.

My Question is: After adding the dll as a reference, I am not able to access the class in the dll. When I'm trying to use the using statement the project is not recognizing the added dll. Can anyone help me out how to go around with this problem?

There is another way in the portal, where we can create a shared folder under the root dir of our function App project, add the common code script file and use #load '../shared commoncodescript.csx'. I don't want to go with this approach as I'm developing and running azure functions locally.
class lib: class library project image,

Added class reference to the function App project image,

using statement in the function app image.

Can anyone also explain the project folder under the dependencies?
Thanks in advance

Roham Rafii
  • 2,929
  • 7
  • 35
  • 49
Sushruth
  • 155
  • 2
  • 11
  • 1
    `IncomingLead` is most likely `internal` instead of `public`. You'll need to post a [mcve] so we can actually help you – Camilo Terevinto Feb 26 '18 at 18:22
  • namespace Utilites { public class IncomingLead { public string sourceName { get; set; } public string leadData { get; set; } public int logIncomingDataid { get; set; } } } – Sushruth Feb 26 '18 at 18:32

1 Answers1

0

I also can reproduce this if the referenced class library target framework is higher than azure function target framework.

If it is this case you could change the class library target framework to azure function target framework.

enter image description here

Another way is that you could create a standard class library

Test result:

enter image description here

Tom Sun - MSFT
  • 24,161
  • 3
  • 30
  • 47