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.

how to add framework reference?

See original GitHub issue

how do you add a framework reference, similar to the following .csproj line:

    <FrameworkReference Include="Microsoft.AspNetCore.App" />

?

The following code block

void F(Microsoft.AspNetCore.SignalR.Hub h) {}

Gives the following error:

The type or namespace name 'Hub' does not exist in the namespace 'Microsoft.AspNetCore.SignalR' (are you missing an assembly reference?)

With .csproj you don’t need an assembly reference, the above FrameworkReference element includes the SignalR dlls.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fwariscommented, Jun 1, 2021

This is starting to affect my current work. Mostly I need to perform visualizations on data, e.g. MSAGL graph viewer that requires Windows Forms.

Priority will be appreciated.

Faisal

0reactions
nycdotnetcommented, Nov 20, 2022

It seems like this does work now, but it’s not documented here.

Example: create a brand new notebook, with a C# block with the following content only:

using System.Net.Http.Json;

When you run it, it will return:

Error: (1,23): error CS0234: The type or namespace name 'Json' does not exist in the namespace 'System.Net.Http' (are you missing an assembly reference?)

If you change the code to:

#r "System.Net.Http.Json.dll"
using System.Net.Http.Json;

It will work. This should be improved in the docs for #r in my opinion (and ideally there should be some sort of suggestion to import the corresponding system DLL like VS and Rider do).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add references in the Reference Manager - Visual Studio ...
In Solution Explorer, right-click the References or Dependencies node, and then choose either Add Project Reference, Add Shared Project ...
Read more >
How to add reference to framework component in Visual ...
If I right click on Dependencies, I have options to add Project, Shared Projects, COM and Browse references. There is no option to...
Read more >
Add ability to easily add a Framework Reference to an SDK ...
I'm envisaging a new context menu item there labelled "Add a Framework Reference..." that opens the add reference dialog on a new pane...
Read more >
Manage references in a project - Visual Studio (Windows)
Or, right-click the project node and select Add > Reference. Screenshot of the Add Reference option from the right-click context menu. For more ......
Read more >
How to Add References to Your Visual Studio Project
From the toolbar, select Project - Add Reference Project - Add Reference · In the Solution Explorer pane, Right click the project then...
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