简体   繁体   中英

Reference c# class library in my Azure Function

Is it possible to reference ac# class library in an Azure Function visual studio project?

I am aware of the possibilities to reference external libraries and Nuget packages. Currently I am using shared .csx files as described here . These .csx files now contain a copy of my DTO's which are also used in the Service Agents which I use to consume the functions.

Ideally I want to add a reference in Visual Studio from a Function to a class library project and that Visual Studio is adding this dll to the bin folder.

Currently, project references are not supported, but you can have the output of your project (the resulting assembly and possible dependencies) copied onto a folder under your function's root, which you can then leverage using the external libraries support you've mentioned above (eg #r "..\\myassemblyfolder\\MyAssembly.dll" )

If possible, I'd suggest opening an issue with that feature request, sharing more about your scenario on this repository . This allows other people to upvote those requests and helps the team prioritize this work.

This is now possible by using the new Visual Studio 2017 Tools for Azure Functions.

You can get more information about this in the following links:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM