Cannot embed using the provided iframe on https://dotnet.microsoft.com/platform/try-dotnet
See original GitHub issueDescribe 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:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In the meantime you should make this clear as the current info is misleading. Would have saved me alot of time.
@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.
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.)Those artifacts need to be publishable, securely, to the Try .NET backend.
Then we can remove the restriction.