在我的 Azure Function 中引用 c# 类库

Reference c# class library in my Azure Function(在我的 Azure Function 中引用 c# 类库)
本文介绍了在我的 Azure Function 中引用 c# 类库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 Azure Function Visual Studio 项目中引用 C# 类库?

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

我知道引用外部库和 Nuget 包的可能性.目前我正在使用共享的 .csx 文件,如 这里.这些 .csx 文件现在包含我的 DTO 的副本,这些副本也用于我用来使用这些功能的服务代理中.

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.

理想情况下,我想在 Visual Studio 中添加一个从函数到类库项目的引用,并且 Visual Studio 正在将此 dll 添加到 bin 文件夹中.

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.

推荐答案

目前不支持项目引用,但您可以将项目的输出(生成的程序集和可能的依赖项)复制到函数根目录下的文件夹中,然后您可以使用上面提到的外部库支持来利用它(例如 #r "..myassemblyfolderMyAssembly.dll")

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 (e.g. #r "..myassemblyfolderMyAssembly.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.

这篇关于在我的 Azure Function 中引用 c# 类库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)