首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何获取myget包的源码?

如何获取myget包的源码?
EN

Stack Overflow用户
提问于 2013-06-24 21:31:43
回答 2查看 2.4K关注 0票数 2

我正在为我的Nuget包使用myget。因为我使用的是带有凭证的私人提要,所以我关注了这个博客:http://www.xavierdecoster.com/deploying-to-azure-web-sites-using-nuget-package-restore-from-a-secured-feed

我的本地(项目) nuget.config (位于解决方案中的.nuget文件夹中)如下所示:

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <solution>
    <add key="disableSourceControlIntegration" value="true" />
  </solution>
  <packageSource>
    <clear />

    <add key="EcareMyGet" value="https://www.myget.org/F/rai69/"></add>

  </packageSource>
  <activePackageSource>
    <add key="EcareMyGet" value="https://www.myget.org/F/rai69/"></add>
  </activePackageSource>
  <packageSourceCredentials>
    <EcareMyGet>
      <add key="Username" value="www.myget.org/raimond" />
      <add key="ClearTextPassword" value="wachtwoord" />
    </EcareMyGet>
  </packageSourceCredentials>
</configuration> 

在我的nuget.targets中,我已经根据博客更改了恢复命令:

代码语言:javascript
复制
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)"   -NonInteractive   $(RequireConsentSwitch) -solutionDir "$(SolutionDir)\" -Verbosity detailed </RestoreCommand>

尽管如此,构建服务器仍然使用nuget.org作为源:

代码语言:javascript
复制
NuGet.exe sources
  Registered Sources:

    1.  https://nuget.org/api/v2/ [Enabled]
        https://nuget.org/api/v2/

谁知道解决方案呢?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-06-24 22:07:37

答案:替换为nuget.config文件中的

下面是导致答案的对话。

为了确认一下,您是否也阅读了禁用-RequireConsent开关的部分?

代码语言:javascript
复制
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">
false
</RequireRestoreConsent>

另外,确保您没有在MSBuild PackageSources元素中配置它,默认情况下,该元素如下所示(未配置包源):

代码语言:javascript
复制
<ItemGroup Condition=" '$(PackageSources)' == '' ">
    <!-- Package sources used to restore packages. 
         By default, registered sources under %APPDATA%\NuGet\NuGet.Config 
         will be used -->
    <!-- The official NuGet package source (https://nuget.org/api/v2/) will be 
         excluded if package sources are specified and it does not appear 
         in the list -->
    <!--
        <PackageSource Include="https://nuget.org/api/v2/" />
        <PackageSource Include="https://my-nuget-source/nuget/" />
    -->
</ItemGroup>

如果你这样做了,而这不是问题所在,你能分享更多关于输出日志的详细信息,以便我可以确定问题是什么时候引起的,是什么命令引起的?

票数 2
EN

Stack Overflow用户

发布于 2013-06-24 21:51:11

您写道您使用"My local ( project ) nuget.config",这让我相信您的nuget.config文件位于您的项目文件夹中。

您可以阅读有关NuGet Config File here的内容。在这里,您将看到"NuGet首先从默认位置加载NuGet.config,然后加载任何名为NuGet.config的文件,从当前驱动器的根开始到当前目录结束。“

这意味着,NuGet将在文件夹层次结构中从根一直查找配置,直到nuget.exe的位置,该位置通常位于解决方案根目录下的.nuget文件夹下。这意味着它永远不会查看解决方案中的项目文件夹。因此,您可以尝试将nuget.config移动到解决方案文件夹,然后查看它,然后正确读取它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17276768

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档