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.

--generate-load-scripts for .NET Core appears to create incorrect #r directives

See original GitHub issue

Description

--generate-load-scripts for .NET Core appears to create incorrect #r directives as it’s including GAC references.

Repro steps

paket.dependencies

source https://nuget.org/api/v2
nuget Newtonsoft.Json

Run:

.paket\paket.exe install --generate-load-scripts load-script-framework netstandard1.6

Expected behavior

The produced CSX file contains only references to physical DLLs from packages folder.

Actual behavior

The produced CSX file contains GAC references too.

#r "System.Xml.Linq" 
#r "System.Xml" 
#r "mscorlib" 
#r "System.Core" 
#r "System" 
#r "System.Runtime.Serialization" 
#r "System.ComponentModel.Composition" 
#r "Microsoft.CSharp" 
#r "../../../packages/Microsoft.CSharp/lib/netstandard1.3/Microsoft.CSharp.dll" 
#r "../../../packages/Newtonsoft.Json/lib/netstandard1.0/Newtonsoft.Json.dll" 
#r "../../../packages/System.Dynamic.Runtime/lib/netstandard1.3/System.Dynamic.Runtime.dll" 
#r "../../../packages/System.IO.FileSystem.Primitives/lib/netstandard1.3/System.IO.FileSystem.Primitives.dll" 
#r "../../../packages/System.Linq/lib/netstandard1.6/System.Linq.dll" 
#r "../../../packages/System.Linq.Expressions/lib/netstandard1.6/System.Linq.Expressions.dll" 
#r "../../../packages/System.ObjectModel/lib/netstandard1.3/System.ObjectModel.dll" 
#r "../../../packages/System.Reflection.Emit/lib/netstandard1.3/System.Reflection.Emit.dll" 
#r "../../../packages/System.Reflection.Emit.ILGeneration/lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll" 
#r "../../../packages/System.Reflection.Emit.Lightweight/lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll" 
#r "../../../packages/System.Reflection.TypeExtensions/lib/netstandard1.5/System.Reflection.TypeExtensions.dll" 
#r "../../../packages/System.Runtime.Handles/ref/netstandard1.3/System.Runtime.Handles.dll" 
#r "../../../packages/System.Runtime.Serialization.Primitives/lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll" 
#r "../../../packages/System.Text.RegularExpressions/lib/netstandard1.6/System.Text.RegularExpressions.dll" 
#r "../../../packages/System.Threading/lib/netstandard1.3/System.Threading.dll" 
#r "../../../packages/System.Threading.Tasks.Extensions/lib/netstandard1.0/System.Threading.Tasks.Extensions.dll" 
#r "../../../packages/System.Xml.ReaderWriter/lib/netstandard1.3/System.Xml.ReaderWriter.dll" 
#r "../../../packages/System.Xml.XDocument/lib/netstandard1.3/System.Xml.XDocument.dll" 
#r "../../../packages/System.IO.FileSystem/ref/netstandard1.3/System.IO.FileSystem.dll" 

Known workarounds

When processing the file, it’s possible to manually strip away the offending references.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:15 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
matthidcommented, Feb 26, 2017

@smoothdeveloper Yes I think that should work

0reactions
smoothdevelopercommented, Feb 28, 2017

@filipw I’ve made a PR, could you check that comment: https://github.com/fsprojects/Paket/pull/2162#issuecomment-283190489 if that matches your expectation?

Read more comments on GitHub >

github_iconTop Results From Across the Web

NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >
System could not be found Visual Studio 2017 ASP.NET ...
So I went into Tools > Nuget Packet Manager and un-checked the wrong one. Hit "Ok", and then rebuilt the project, and it...
Read more >
Stop using the HttpClient the wrong way in .NET - YouTube
NET could be completely wrong and then follow it up by showing you the right way to implement it. Workshops NDC Oslo |...
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