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.

Cannot embed using the provided iframe on https://dotnet.microsoft.com/platform/try-dotnet

See original GitHub issue

Describe the bug

If I try to embed try .net with this iframe (taken from https://dotnet.microsoft.com/platform/try-dotnet):

<h2>Fibonacci Generator</h2>
<p>Here is my example of a Fibonacci generator implemented in C#.</p>

<iframe src="https://try.dot.net/?fromGist=df44833326fcc575e8169fccb9d41fc7">
</iframe>

You get Content Security Policy errors. It doesn’t work out of the box and its not clear how to fix this. It should be possible somehow as some ppl are using it but a example should work without having to fix it.

Did this error occur while using dotnet try or online?

  • dotnet-try
  • online

What kind of error was it?

  • User Interface (UI): For example the output never displayed
  • Service Error: For example “The service is temporarily unavailable. We are working on it”
  • Other:

Screenshots

If applicable, add screenshots to help explain your problem.

Please complete the following:

  • OS
    • Windows 10
    • macOS
    • Linux (Please specify distro)
    • iOS
    • Android
  • Browser
    • Chrome
    • Edge
    • Safari

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
Barsonaxcommented, Jun 28, 2019

In the meantime you should make this clear as the current info is misleading. Would have saved me alot of time.

3reactions
jonsequiturcommented, Oct 25, 2019

@Barsonax There’s a decent amount of work that needs to be done beyond removing the IFRAME restriction before embedding is all that useful, which is why we haven’t done it yet.

  1. You need a way to a) create a project against which the Try .NET service compiles code submissions, responds to intellisense requests, etc., so you can create samples using the NuGet packages of your choice, and b) create a custom Blazor app that Try .NET delivers to users’ browsers, where the compiled user code is executed. (The tool to do these things is dotnet try pack, but the feature isn’t where we want it yet.)

  2. Those artifacts need to be publishable, securely, to the Try .NET backend.

  3. Then we can remove the restriction.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to embed Try.NET console in my cshtml page
I try to use https://dotnet.microsoft.com/en-us/platform/try-dotnet TryDotNet interactive console in my project.
Read more >
Unable to embed videos on SharePoint pages
I have a "Media Hosting" document library where we've previously uploaded mp4 videos to. In the past, I've been able to copy the...
Read more >
Embedding PPT requires Sharepoint login
I am attempting to embed a PowerPoint presentation into a page on my ... but I cannot embed the PPT presentation w/o the...
Read more >
Embed .net core web application in web forms - Microsoft Q&A
I want to embed the pages in new website in the existing web application. Using iframe , I can just load the new...
Read more >
Call JavaScript functions from .NET methods in ASP.NET Core ...
These APIs can't be called through the JS interop mechanism in Blazor Server apps because UI event handling is performed asynchronously and ...
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