question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Paket (in library and console) add reference for System.Windows.Forms / WindowsBase

See original GitHub issue

Description

paket 5.172.1

We’re having jobs every night that removes paket.lock and run paket install then fake build Most of our libs are Owin or technology/framework agnostic We also have few sample bootstrapping WebApi within Console app

Actual behavior

I’m starting to see diff like this :

  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.2'">
      <ItemGroup>
        <Reference Include="System.Windows">
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Windows.Forms">
          <Paket>True</Paket>
        </Reference>
        <Reference Include="WindowsBase">
          <Paket>True</Paket>
        </Reference>
        <Reference Include="System.Reactive">
          <HintPath>..\..\packages\System.Reactive\lib\net46\System.Reactive.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>

Expected behavior

It should not start adding GAC reference in csproj, especially WindowsBase System.Windows.Forms System.Windows

Known workarounds

Manually delete them, in EACH csproj one by one This one is trully fearsome

I would recommand Paket BLOCKING the paket install with a Yes/No question (with an opt out like --force) This prompt explain the WHY it is adding a GAC reference … especially big one like this …

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
inosikcommented, Jun 12, 2018

This is in the .nuspec file of System.Reactive 4.0.0:

    <frameworkAssemblies>
      <frameworkAssembly assemblyName="System.Windows" targetFramework=".NETFramework4.6" />
      <frameworkAssembly assemblyName="System.Windows.Forms" targetFramework=".NETFramework4.6" />
      <frameworkAssembly assemblyName="WindowsBase" targetFramework=".NETFramework4.6" />
    </frameworkAssemblies>

So Paket works as expected here. I just wonder why System.Reactive depends on some Windows-specific assemblies. Version 3.1.1 doesn’t depend on them, not even indirectly.

0reactions
tebecocommented, Jun 12, 2018

thx i missed tha, i was tired … my bad

i’ll check the lib and console using netcoreapp / netstandard because it leaks in projects.assets.json as this sln don’t use paket … closing this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Library requires reference to System.Windows.Forms
The problem being that any library or executable that references the utilities library must now have a reference to System.Windows.Forms as well ...
Read more >
Cannot reference System.Windows.Forms. ...
First, please right-click Add-Reference and then choose the Assemblies tab. 267113-image.png. Second, please input System.Windows.Forms.
Read more >
Make it easier to reference WinForms and other libraries in ...
Yes, I know that console apps and WinForms apps are two separate entities, but it is very convenient to be able to mix...
Read more >
How to add reference to system.windows.media in .NET 6 ...
I was trying to include them in a .Net 6 class library to use them across multiple projects, But I couldn't add reference...
Read more >
How to add a reference to the System.Windows.Forms lib from ...
In this video, I'll show you how to add a reference to the System. Windows. Forms library from a .NET Core WPF project....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found