<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Nuget on queil.net</title>
    <link>https://queil.net/tags/nuget/</link>
    <description>Recent content in Nuget on queil.net</description>
    <generator>Hugo</generator>
    <language>en-uk</language>
    <lastBuildDate>Fri, 04 Jun 2021 08:52:26 +0100</lastBuildDate>
    <atom:link href="https://queil.net/tags/nuget/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Embedding F# Compiler: NuGet References</title>
      <link>https://queil.net/2021/06/embedding-fsharp-compiler-nuget-references/</link>
      <pubDate>Fri, 04 Jun 2021 08:52:26 +0100</pubDate>
      <guid>https://queil.net/2021/06/embedding-fsharp-compiler-nuget-references/</guid>
      <description>&lt;p&gt;UPDATE: If you are looking for a ready to use solution please check out my &lt;a href=&#34;https://github.com/queil/fsc-host&#34;&gt;fsc-host&lt;/a&gt; NuGet package. Also I wrote a &lt;a href=&#34;https://queil.net/2021/10/embedding-fsharp-compiler-fsc-host-nuget/&#34;&gt;blog post&lt;/a&gt; about it.&lt;/p&gt;&#xA;&#xA;&lt;h2 id=&#34;intro&#34; class=&#34;anchor-link&#34;&gt;&lt;a href=&#34;#intro&#34;&gt;Intro&lt;span class=&#34;pilcrow&#34;&gt;&amp;nbsp;¶&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;In the &lt;a href=&#34;https://queil.net/2021/05/embedding-fsharp-compiler/&#34;&gt;previous post&lt;/a&gt; I showed how to extend an F# application with scripting capabilities. This time I want to extend the previous example with the &lt;a href=&#34;https://docs.microsoft.com/en-us/dotnet/fsharp/tools/fsharp-interactive/#referencing-packages-in-f-interactive&#34;&gt;#r directive&lt;/a&gt; support and resolving NuGet dependencies.&lt;/p&gt;&#xA;&#xA;&lt;h2 id=&#34;how-to&#34; class=&#34;anchor-link&#34;&gt;&lt;a href=&#34;#how-to&#34;&gt;How to&lt;span class=&#34;pilcrow&#34;&gt;&amp;nbsp;¶&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;On high level we need to extract NuGet packages information from the script and pass it to the compiler as additional arguments. Before compiling we also need to dynamically load the referenced dlls to the host application. I first took the naive approach of parsing and extracting the directives from AST and feeding them into &lt;code&gt;FSharpDependencyManager&lt;/code&gt;. It worked to an extent. Luckily, &lt;code&gt;FsChecker&lt;/code&gt; comes with a built-in solution. We can use &lt;code&gt;GetProjectOptionsFromScript&lt;/code&gt; and subsequently &lt;code&gt;ParseAndCheckProject&lt;/code&gt; methods. That way we can retrieve &lt;code&gt;DependencyFiles&lt;/code&gt; and extract resolved dlls&amp;rsquo; paths.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Seamless Debugging of NuGet Packages</title>
      <link>https://queil.net/2019/08/seamless-debugging-of-nuget-packages/</link>
      <pubDate>Wed, 14 Aug 2019 18:15:52 +0100</pubDate>
      <guid>https://queil.net/2019/08/seamless-debugging-of-nuget-packages/</guid>
      <description>&lt;h2 id=&#34;introduction&#34; class=&#34;anchor-link&#34;&gt;&lt;a href=&#34;#introduction&#34;&gt;Introduction&lt;span class=&#34;pilcrow&#34;&gt;&amp;nbsp;¶&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Sharing and reusing code between developers and teams has always been a serious challenge. Done badly it may gravely impede development and result with mediocre quality. Sharing source code per se has lots of problems on its own. Therefore, virtually every technology stack has a way of distributing versioned binaries instead. NuGet is the standard for sharing binaries in the .NET world. In open-source communities it&amp;rsquo;s natural to be able to view source code of a binary package. The next step is an ability to debug third-party binaries if debugging symbols are present. This, however, requires the source code to be downloaded and the debugger to be pointed to it. &lt;a href=&#34;https://github.com/dotnet/sourcelink&#34;&gt;Source Link&lt;/a&gt; is an attempt to make the whole experience seamless. Essentially, it works by enriching packages&amp;rsquo; metadata with source control specific information which then can be used on debug time to automatically download and display required source code.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
