Skip to content

Commit 9c4ce87

Browse files
committed
feat: add article tips I learn this week 11 2025
1 parent a3922f3 commit 9c4ce87

File tree

6 files changed

+71
-1
lines changed

6 files changed

+71
-1
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: Week 11, 2025 - Tips I learned this week
3+
lead: Some tips about .NET, vscode, git, HTTP
4+
date: 2025-03-17
5+
image:
6+
src: /images/surface_1.jpg
7+
badge:
8+
label: Tips
9+
tags:
10+
- tips learned this week
11+
- .NET
12+
- vscode
13+
- git
14+
- GitHub
15+
- HTTP
16+
ImageAttribution: Picture of <a href="https://unsplash.com/fr/@surface?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Surface</a> on <a href="https://unsplash.com/fr/photos/appareil-surface-sur-la-table-taHYzvApW1o?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Unsplash</a>
17+
---
18+
## .NET tip of the week: use the .NET Upgrade Assistant tool to upgrade your project to a new version of .NET
19+
20+
In case you don’t know, when you want to upgrade to a new version of .NET, instead of manually going through all your `csproj` files to change the version and upgrade your dependencies you can use a dotnet tool to automate that: the [.NET Upgrade assistant](https://learn.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview).
21+
22+
You can install it as a global .NET tool:
23+
24+
```bash
25+
dotnet tool install -g upgrade-assistant
26+
```
27+
28+
And then upgrade your project using the upgrade command:
29+
30+
```bash
31+
upgrade-assistant upgrade
32+
```
33+
34+
## Vscode extension pack of the week: Remote Repositories
35+
36+
Sometimes, we don’t want to clone an entire git repository but just to have a look at it, see how the code is written and that’s it. Browsing code on GitHub is fine but let’s be honest when you start to spend some time in the repository, to search some code it’s not the best experience. Thanks to the [Remote Repositories vscode extension pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode.remote-repositories), you can directly browse code in your vscode without having to clone anything. There are two separate extensions depending on where your git repository is located: [GitHub Repositories](https://marketplace.visualstudio.com/items?itemName=GitHub.remotehub) and [Azure Repos](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-repos).
37+
38+
![Visual Studio Code extension page for "Remote Repositories" by Microsoft. It shows options for GitHub Repositories and Azure Repos.](/posts/images/72.w112025tips-3.png){.rounded-lg.mx-auto width="1000"}
39+
40+
I find it particularly useful when you want to browse open source code samples.
41+
42+
![Screenshot of the vscode Remote Repositories view with the editor opened on README of .NET Aspire samples.](/posts/images/72.w112025tips-4.png){.rounded-lg.mx-auto}
43+
44+
## Troubleshoot your HTTP requests using devtunnels echo
45+
46+
Recently, a colleague was trying to troubleshoot HTTP requests to an API that were failing when sent from some C# code but succeeding from another tool. The issue was due to a difference in the User Agent between the two requests. At the time, I didn't think of it, but he could have discovered the problem sooner by using the [`devtunnels echo` command](https://learn.microsoft.com/en-us/azure/developer/dev-tunnels/cli-commands#diagnostic-commands). This command sets up a simple server that returns the content of a request. By sending the requests to the localhost `echo` endpoint instead of the API, he could have easily compared the requests from his two tools.
47+
48+
![Terminal window showing a command to start an echo server on port 8080 using "devtunnel." The server listens at http://127.0.0.1:8080.](/posts/images/72.w112025tips-1.png){.rounded-lg.mx-auto width="800"}
49+
50+
![Terminal showing an HTTP GET request to "http://localhost:8080" using the "nushell" User-Agent.](/posts/images/72.w112025tips-2.png){.rounded-lg.mx-auto width="800"}
51+
52+
## Git tip I did know about
53+
54+
The other day, I was doing a lab with students and I wanted to share to them the correction of the parts we corrected together, but not the ones we did not correct. So I wanted to push only a part of the commits on my branch.
55+
56+
On the repository on GitLab there was on the main branch: A → B
57+
58+
On my local repository, I had the main branch: A → B → C → D → E → F
59+
60+
C and D were commits containing the corrections of the parts we did together, so I wanted to push them but not push E and F.
61+
62+
I just had to do `git push 1ae242:main` where `1ae242` is the hash of the commit D.
63+
64+
::callout{icon="i-heroicons-light-bulb"}
65+
Check the `git push` [documentation](https://git-scm.com/docs/git-push#Documentation/git-push.txt-ltrefspecgt82308203) to learn more about the different options.
66+
::
67+
68+
---
69+
70+
And that's it for this week, happy learning!

nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default defineNuxtConfig({
1919
],
2020
content: {
2121
highlight: {
22-
langs: ['json', 'js', 'ts', 'html', 'xml', 'css', 'vue', 'shell', 'mdc', 'md', 'yaml', 'csharp', 'powershell', 'http', 'nushell', 'razor', 'powershell', 'sql']
22+
langs: ['json', 'js', 'ts', 'html', 'xml', 'css', 'vue', 'shell', 'mdc', 'md', 'yaml', 'csharp', 'powershell', 'http', 'nushell', 'razor', 'powershell', 'sql'],
2323
},
2424
},
2525
site: {
18.4 KB
Loading
22.9 KB
Loading
82.4 KB
Loading
320 KB
Loading

0 commit comments

Comments
 (0)