Skip to content

Visual Studio 2022 support with .NET 6 installation - #49

Merged
jefflill merged 294 commits into
nforgeio:mainfrom
StanDeMan:main
Oct 24, 2023
Merged

jefflill merged 294 commits into
nforgeio:mainfrom
StanDeMan:main

Conversation

@StanDeMan

@StanDeMan StanDeMan commented Dec 4, 2021 •

Copy link
Copy Markdown
Contributor
  • Support for Visual Studio 2022 only because of Visual Studio SDK API changes
  • .NET 6 gets installed the first time starting the debugger with a Raspian without .NET installed
    -> no tests done if any .NET is preinstalled. Behaviour for this situation is unkown so far.
  • Using standard OpenSSH from Windows 10/11
  • Only actual .NET SDKs versions (Core 3.1. .NET 5 + 6) included in catalog json

@daim2k5 daim2k5 mentioned this pull request Jan 3, 2022
@MagicAndre1981

Copy link
Copy Markdown
Contributor

can you also add my PR #38 and provide a vsix until this is merged ?

@SidineiSantosSousa

Copy link
Copy Markdown

Can you provide the vsix file? Thank you for the hard work!

@StanDeMan

Copy link
Copy Markdown
Contributor Author

Can you provide the vsix file? Thank you for the hard work!

For me it was a pleasure. The hard work was done by nforgeio. I am fairly new to github. Where can I make the vsix file available? Let me know, please.

@MagicAndre1981

Copy link
Copy Markdown
Contributor

Where can I make the vsix file available? Let me know, please.

submit it with an different ID to gallery until it is merged.

Can you also add my PR and update the lib to 17.x version.

@StanDeMan

Copy link
Copy Markdown
Contributor Author

Thanks MagicAndre1981, I'll try to submit it to gallery.

@tlemmons

Copy link
Copy Markdown

I checked out this branch and built it then used the debug vsix to install to VS 2022. However when I go to add a new raspberry connection and fill in the known good details, it locks up and I have to kill VS with the task manager. Any ideas before I start digging into a debug cycle?

@StanDeMan

StanDeMan commented Feb 28, 2022 •

Copy link
Copy Markdown
Contributor Author

Is it an ASP.NET project? It's searching for an "Absolute path" - don't know why. Seems to be an VS debugging issue. Have the same. Not opened a ticket at Microsoft Studio Team so far. The rest was working well for me. Use it quite often.
Another issue with this VS extension seems to be only one project is transferred to RasPi - not a solution including multiple projects inside. Feel free to debug and let us participate, please - to get this great work even better! Thanks a lot.

@tlemmons

tlemmons commented Feb 28, 2022 via email

Copy link
Copy Markdown

@jefflill

Copy link
Copy Markdown
Collaborator

Hi guys. I'm so sorry I've neglected the debugger for the last year+. I've not had the energy.

What would you think about being promoted to be maintainers?

@daim2k5

daim2k5 commented Mar 3, 2022

Copy link
Copy Markdown

@StanDeMan do you need still help to publish the vsix?
@jefflill sounds good. Are you suggest @StanDeMan as Maintainer?

@StanDeMan

Copy link
Copy Markdown
Contributor Author

@daim2k5 Nop. Thanks. Kann publish the VSIX.

Without fixing the mentioned (known) issues:

  • ASP.NET -> Debugger wants to have an "Absolute Path" -> this is something to ask Microsoft to get it fixed. Pretty strange! ;)
  • Only one project in a solution gets deployed to RasPi

I try to publish till end of this week.
@ALL Feel free to get the known issues from above fixed, please.
@jefflill Thanks a lot for your great work!
Kindest Regards
Stanislaus

@StanDeMan

Copy link
Copy Markdown
Contributor Author

@ALL I published the vsix but it is private in the market place. Does Mircosoft check it first - like Google does in their stores?

@daim2k5

daim2k5 commented Mar 5, 2022 •

Copy link
Copy Markdown

@StanDeMan which status do you see on https://marketplace.visualstudio.com/manage ?
also please check the short video https://www.youtube.com/watch?v=4lXH4EmzMzU maybe you forgot to make it public after MS checked the extension?

@StanDeMan

Copy link
Copy Markdown
Contributor Author

@daim2k5 hm? Still "not public". Maybe I need to get a publisher, registering a DNS - what i don't have? I'll watch the youtube video. Thanks a lot.

@StanDeMan

StanDeMan commented Mar 6, 2022 •

Copy link
Copy Markdown
Contributor Author

@ALL Now it's public. Missed the free dots and the menu in there - making it public. ;)
https://marketplace.visualstudio.com/items?itemName=GingerMintSoft-OpenSource.RaspberryDebugger

@daim2k5 Thanks for the video.

ASP.NET is still an issue - telling the debugger an "Absolue Path" is needed.
So feel free to fix this if someone is able to, please. If not I'll open an issus at MS VS team to get this (ASP.NET 6?) bug closed.
Let us/me know. Thanks again.

Kindest regards - Stanislaus

@MagicAndre1981

Copy link
Copy Markdown
Contributor

@ALL Now it's public. Missed the free dots and the menu in there - making it public. ;) https://marketplace.visualstudio.com/items?itemName=GingerMintSoft-OpenSource.RaspberryDebugger

thanks, works so far in 17.2 Preview 1.0 with console app with .net 6 and RP4 .

rasppi_debug

But if a csproj contains more at least 2 targetframeworks, the app always runs on the local windows with. So it would be nice to port my PR to VS2022

@StanDeMan

Copy link
Copy Markdown
Contributor Author

@ [MagicAndre1981] Thanks a lot for your feedback. Can you do the PR against my repo, please? I'll do the port asap.
@ all ASP.NET debugging is still not working because of ASP.NET 6 wants to have an "absolute path". This is so strange! :(
If someone is able to fix this send the PR too please.

@MagicAndre1981

Copy link
Copy Markdown
Contributor

@ [MagicAndre1981] Thanks a lot for your feedback. Can you do the PR against my repo, please? I'll do the port asap.

Ok, I created a PR, but I can't test my PR, because the entry Raspberry Debug Settings is missing in the 2022 version and I have no idea to debug this.

@StanDeMan

Copy link
Copy Markdown
Contributor Author

@ MagicAndre1981 Thanks for the PR. Let me see. For the moment I only support .NET 6 - as mentioned for upload. So I have to do more work here...
Debugging is really simple. Open the VSIX project and start it as usual with F5 -> the VSIX gets startet inside a Visual Studio Instance. Now you have two instances running - one hosting the VSIX and the Studio with the opened VSIX Code for debugging. With a powerfull computer debugging should go smooth.

@MagicAndre1981

Copy link
Copy Markdown
Contributor

yes, this is clear, but I have no idea where to find the code that shows the entry Raspberry Debug Settings and why it doesn't show up.

@StanDeMan

Copy link
Copy Markdown
Contributor Author

Okay. Sorry. For me it is the first VSIX I came into contact with. Never did this before.
Let me see what happens. But give me some time, please. I'm doing this in my spare time. Thanks a lot.

@MagicAndre1981

Copy link
Copy Markdown
Contributor

ok, IsActiveProjectRaspberryCompatible returns false for csproj with multiple TargetFrameworks in your version and true for original extension in VS2019. This is why the entry is removed from menu.

@StanDeMan

Copy link
Copy Markdown
Contributor Author

@MagicAndre1981 Thanks a lot. I'll take the PR and check this. If everything goes well I'll create and push a new VSiX.
Thanks again.

@MagicAndre1981

Copy link
Copy Markdown
Contributor

ok, the check for IsStandalone looks to be the cause for returning false. Adding PackageHelper.SdkGoodCatalog.Items to watch window shows only .net 6 has IsStandalone set to true. But where does this come from?

@MagicAndre1981

Copy link
Copy Markdown
Contributor

ok, this IsStandalone is indeed wrong. The 100, 200, 300 are feature levels and no indication for standalone or VS bundled SDK version. 100 is the first SDK shipped with VS2022 17.0, 200 is shipped/compatible with VS2022 17.1. if you don't use Visual Studio at all, always pick the highest version to get most features.

rasppi_debug_

I need to test it more, but my original PR still works, I have csproj with 3 frameworks and my selected 6.0 can be debugged.

You also need to update the SDK/runtimes to lastest versions from March 2022 patchday.

@MagicAndre1981

Copy link
Copy Markdown
Contributor

there are more bugs. The TargetFrameworkMonikers from project system in CopyFrom method only returns the first targetframework, so <TargetFrameworks>netcoreapp3.1;net48</TargetFrameworks> would treat the project as compatible.

@Reveon

Reveon commented Mar 30, 2022

Copy link
Copy Markdown

@StanDeMan

I am using Blazor Wasm and I was also getting 'The path must be absolute' Exception if there is no
<RuntimeIdentifier>linux-arm</RuntimeIdentifier> in sever csproj but with it it works just fine.

Adding my Server and Client csproj config - maybe it helps.

server csproj:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <PublishTrimmed>false</PublishTrimmed>
    <RuntimeIdentifier>linux-arm</RuntimeIdentifier>
  </PropertyGroup>

Blazor csproj:

<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly" TreatAsLocalProperty="SelfContained">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
    <PublishTrimmed>true</PublishTrimmed>
    <SelfContained>true</SelfContained>
  </PropertyGroup>

@StanDeMan

StanDeMan commented Mar 30, 2022 •

Copy link
Copy Markdown
Contributor Author

@StanDeMan

I am using Blazor Wasm and I was also getting 'The path must be absolute' Exception if there is no <RuntimeIdentifier>linux-arm</RuntimeIdentifier> in sever csproj but with it it works just fine.

Adding my Server and Client csproj config - maybe it helps.

@Reveon

Thanks a lot for this hint. I get exactly the same error if I try to debug ASP.NET projects with wwwroot path - without wwwroot everything is working well. Hopefully I'll have a few free minutes this weekend to take MagicAndre1981's changes and test this hint. It would be nice if a new version can be built and made available in NuGet. I'll see what can be done. Thanks a lot for the support.

Kindest regards
StanDeMan

@Reveon
That's it. Thanks a lot.
Had to put this into my project file property group:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    ...
    <RuntimeIdentifier>linux-arm</RuntimeIdentifier>
  </PropertyGroup>

Asp.NET debugging is working now! :) Nothing to do with the debugger!
Cheers!
StanDeMan

@tlemmons

tlemmons commented Apr 2, 2022

Copy link
Copy Markdown

Sorry I have been away and swamped. Just getting back to this. I have downloaded the latest built and trying to debug. When I create a new connection to my raspberry pi 4, it tries to connect and never returns. I have traced it to connection.cs -> connectAsync line 91. I have tried changing the timespan to a few seconds and putting a try catch around it but it still never returns. Any ideas on tracing farther in or why this would be the case? @StanDeMan you said it needed an "Absolute path" but I am not seeing anything about that.

@jefflill

jefflill commented Oct 11, 2022 via email

Copy link
Copy Markdown
Collaborator

@StanDeMan

Copy link
Copy Markdown
Contributor Author

Hi Jeff, it's okay for me to give me the rights. You are welcome. I published the stuff on my own VS Marketplace.
Let me know if this is okay for you?

I implemented a html grepping service to grep the actual .NET versions every day into a json file, too. Do you know where I can host this for free? My Azure Account gets shut off for some days at the end of the month - having too many services hosted. ;) Heroku seems not to be an option. Wasn't able to host for free so far. Don't know why this wasn't working? Have to try once again. If the service cannot be reached the debugger is still working - using the deployed json in the debugger release - only actual on release date. But the service is always sending the actual .NET versions available on Microsoft download pages.

Thanks a lot for your great work and tool! We love it! :)

Kindest regards
StanDeMan

@jefflill

jefflill commented Oct 12, 2022 via email

Copy link
Copy Markdown
Collaborator

@jefflill
jefflill merged commit b231d52 into nforgeio:main Oct 24, 2023
@jefflill

Copy link
Copy Markdown
Collaborator

Merged to: main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants