Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/307.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/24.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# Microsoft Azure函数Nuget程序包阻止NET Library打包到Nuget中_C#_.net_Azure_Azure Functions_Azure Sdk - Fatal编程技术网

C# Microsoft Azure函数Nuget程序包阻止NET Library打包到Nuget中

C# Microsoft Azure函数Nuget程序包阻止NET Library打包到Nuget中,c#,.net,azure,azure-functions,azure-sdk,C#,.net,Azure,Azure Functions,Azure Sdk,我有一个以net462为目标的网络库项目,它包括一个Microsoft.NET.SDK.FunctionsNuget包。问题是,当我将我的项目打包到一个Nuget库中时,它会成功(清理、恢复、构建、打包),但没有创建任何.nupkg。如果我注释掉相关代码并去掉Nuget引用,则打包时会生成一个nupkg文件 我似乎在讨论这个问题:也许吧 有关方案- 我的直接问题是——这是一个可能的特性吗?你能阻止你的包裹被塞进纽吉吗?我怎么知道。或者换句话说,这种情况(GitHub问题中描述的情况)可能吗?出了

我有一个以net462为目标的网络库项目,它包括一个
Microsoft.NET.SDK.Functions
Nuget包。问题是,当我将我的项目打包到一个Nuget库中时,它会成功(清理、恢复、构建、打包),但没有创建任何.nupkg。如果我注释掉相关代码并去掉Nuget引用,则打包时会生成一个nupkg文件

我似乎在讨论这个问题:也许吧

有关方案-

我的直接问题是——这是一个可能的特性吗?你能阻止你的包裹被塞进纽吉吗?我怎么知道。或者换句话说,这种情况(GitHub问题中描述的情况)可能吗?出了什么问题?谢谢

步骤1:打开项目文件夹

步骤2:打开cmd

步骤5:您应该看到一个指向您的项目而不是解决方案目录的cmd

步骤6:复制并通过流动命令
PowerShell-Command“Get ChildItem$dir | Where{$\.Name-match'.csproj'}| Select-Expand-Name | out file-encoding ASCII projectname”

SET/p projectname=您能提供您的用例吗?为什么你要将azure函数打包到nuget?你能详细说明从头开始复制的步骤吗?@VolodymyrBilyachat我正在编写一个库来生成Http触发函数应用程序的招摇过市。所以我必须包括函数库。代码需要一组引用来检查函数以生成Swagger。@有更新吗?这不是正确答案。我不想浪费赏金。@jn1kk
    PowerShell -Command "Get-ChildItem $dir | Where { $_.Name -match '.csproj'} | Select -Expand Name | out-file -encoding ASCII projectname"

    SET /p projectname=<projectname

    PowerShell -Command "(Get-Content -path ..\packages\Microsoft.NET.Sdk.Functions.1.0.24\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets -Raw) -replace 'DependsOnTargets="""RunResolvePublishAssemblies"""', '' | Set-Content -Path  ..\packages\Microsoft.NET.Sdk.Functions.1.0.24\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets"

    SET MSBuild_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin

    SET PATH=%MSBuild_PATH%;%PATH%

    MSbuild %projectname% /t:Clean;Rebuild /p:Configuration=Release

    PowerShell -Command "Get-ChildItem -Path .\bin\Release\bin -Recurse | Copy-Item -Destination .\bin\Release "

    PowerShell -Command "if(!(Test-Path -Path 'nuget.exe')){(new-object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe','nuget.exe')}"

    NuGet.exe pack %projectname% -Prop Configuration=Release -MSBuildPath "%MSBuild_PATH%"

    start .