Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/256.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何访问作为资源嵌入在.NETCore的nuget包中的文件_C#_.net Core_Nuget_Swagger - Fatal编程技术网

C# 如何访问作为资源嵌入在.NETCore的nuget包中的文件

C# 如何访问作为资源嵌入在.NETCore的nuget包中的文件,c#,.net-core,nuget,swagger,C#,.net Core,Nuget,Swagger,我有一个类项目,我想用它作为API的基类,这个基类应该包含我自己修改过的swagger-ui.js版本 如果我构建项目,在bin\debug\netcoreapp2.0文件夹中,我会得到以下文件: MyServiceCommon.dll MyServiceCommon.deps.json \swagger ui\swagger-ui.js 然而,当这个项目被构建到一个nuget包中时,在我引用它的api项目中,我只会看到 bin\debug文件夹中的MyServiceCommon.dll 我如何

我有一个类项目,我想用它作为API的基类,这个基类应该包含我自己修改过的swagger-ui.js版本

如果我构建项目,在bin\debug\netcoreapp2.0文件夹中,我会得到以下文件: MyServiceCommon.dll MyServiceCommon.deps.json \swagger ui\swagger-ui.js

然而,当这个项目被构建到一个nuget包中时,在我引用它的api项目中,我只会看到 bin\debug文件夹中的MyServiceCommon.dll


我如何才能访问此引用项目中的\swagger ui\swagger-ui.js文件?

您是否考虑过将资源嵌入DLL本身?是的,但不确定如何提取它您将使用
Assembly.GetManifestResourceStream
-这对于.NET Core来说没有改变。