From f5de2b91ddb9bfbe9ad46280d79f2d5f56af4978 Mon Sep 17 00:00:00 2001 From: Lex Li Date: Fri, 19 Apr 2024 20:51:50 -0400 Subject: [PATCH] Fixed some markdown issues. --- ...-write-add-ins-of-visual-studio-for-mac.md | 4 +- ...isual-studio-2017-rc-installation-error.md | 2 +- ...edtext-extension-broken-in-vscode-1-9-0.md | 1 + .../2017-3-11-snmp-pro-goes-to-net-core.md | 2 +- ...-to-upgrade-xunit-net-projects-to-2-2-0.md | 2 +- ...ould-be-contacted-for-php-on-iis-issues.md | 2 +- ...t-to-go-in-visual-studio-2015-2017-2019.md | 3 ++ ...to-build-net-core-solutions-on-appveyor.md | 9 +++- .../2017-4-29-plan-for-snmp-library-vnext.md | 5 +- ...tupid-story-of-installing-monodevelop-7.md | 1 + ...eb-apps-on-iis-with-httpplatformhandler.md | 47 ++++++++++--------- .../2024-3-16-pysnmp-and-home-assistant.md | 6 +-- ...eb-apps-on-iis-with-httpplatformhandler.md | 8 ++-- ...eb-apps-on-iis-with-httpplatformhandler.md | 10 ++-- ...eb-apps-on-iis-with-httpplatformhandler.md | 9 ++-- .../2024/2024-4-8-httpplatformhandler-v2.md | 1 + 16 files changed, 65 insertions(+), 47 deletions(-) diff --git a/_posts/2017/2017-1-21-how-to-write-add-ins-of-visual-studio-for-mac.md b/_posts/2017/2017-1-21-how-to-write-add-ins-of-visual-studio-for-mac.md index 237edf1263b..2012de66657 100644 --- a/_posts/2017/2017-1-21-how-to-write-add-ins-of-visual-studio-for-mac.md +++ b/_posts/2017/2017-1-21-how-to-write-add-ins-of-visual-studio-for-mac.md @@ -12,12 +12,14 @@ So what are the steps to build such an add-in? Below I try to show some technica ## Visual Studio for Mac + Microsoft announced this new IDE last year at Connect 2016 keynote, which is a surprise for many developers. But if we check this IDE further, easily we can see it is not a surprise at all. * This IDE is based on MonoDevelop/Xamarin Studio, which has a very long history already. * It reuses many useful ingredients from Visual Studio itself, such as the editor experience. ## Extension Authoring + Previously to develop extensions for MonoDevelop/Xamarin Studio, we need to target the 5.x or 6.x profiles of MonoDevelop core binaries. That's why for [xUnit.net add-in](https://github.com/xunit/xamarinstudio.xunit) there are two branches, 5.0 and 6.0. The core assemblies have significant differences in editor related APIs, due to the big upgrade in Xamarin Studio 6.x. And now again, Visual Studio for Mac (based on MonoDevelop 7.x) requires a new branch. @@ -42,6 +44,6 @@ Then a `.mpack` file would be generated and everyone can manually add it to Visu > Note that once the add-in repository for Visual Studio for Mac is alive, you don't need to share `.mpack` file in this way. -Now Microsoft/Xamarin has opened up the addin feed for Visual Studio for Mac, so as publisher you should use https://addins.monodevelop.com to publish your addin. Users then use the integrated Extension Manager to search and install. +Now Microsoft/Xamarin has opened up the addin feed for Visual Studio for Mac, so as publisher you should use [this website](https://addins.monodevelop.com) to publish your addin. Users then use the integrated Extension Manager to search and install. > Updated (Jan 12, 2023): The latest news can be found in [this post](https://learn.microsoft.com/visualstudio/mac/migrate-extensions?view=vsmac-2022) diff --git a/_posts/2017/2017-1-28-strange-visual-studio-2017-rc-installation-error.md b/_posts/2017/2017-1-28-strange-visual-studio-2017-rc-installation-error.md index 12028f4944a..4395773b921 100644 --- a/_posts/2017/2017-1-28-strange-visual-studio-2017-rc-installation-error.md +++ b/_posts/2017/2017-1-28-strange-visual-studio-2017-rc-installation-error.md @@ -7,7 +7,7 @@ permalink: /strange-visual-studio-2017-rc-installation-error-acdce0000c34 excerpt_separator: --- -I met the below issue, +I met the issue below, ``` text The product failed to install the listed workloads and components due to one or more package failures. diff --git a/_posts/2017/2017-2-18-restructuredtext-extension-broken-in-vscode-1-9-0.md b/_posts/2017/2017-2-18-restructuredtext-extension-broken-in-vscode-1-9-0.md index 6a71ad5c6f0..9413ee0390b 100644 --- a/_posts/2017/2017-2-18-restructuredtext-extension-broken-in-vscode-1-9-0.md +++ b/_posts/2017/2017-2-18-restructuredtext-extension-broken-in-vscode-1-9-0.md @@ -15,6 +15,7 @@ So I was planning to take a look once I finally arrived but VS Code 1.9.1 releas Luckily I had some reliable guy in the VS Code team itself, who kindly informed me the culprit is [a change they made in 1.9.0](https://github.com/Microsoft/vscode/issues/20229) (reverted in 1.9.1), where broken HTML pages won't be loaded into VS Code views. Thus, can you imagine that Sphinx generates broken HTML pages? Of course not. Let's see one example below, + ``` html diff --git a/_posts/2017/2017-3-11-snmp-pro-goes-to-net-core.md b/_posts/2017/2017-3-11-snmp-pro-goes-to-net-core.md index 67b4e0f97df..f96789cecac 100644 --- a/_posts/2017/2017-3-11-snmp-pro-goes-to-net-core.md +++ b/_posts/2017/2017-3-11-snmp-pro-goes-to-net-core.md @@ -17,7 +17,7 @@ Of course, we have to make a few changes so as to adapt to the new platform, and We will release a new release (1.3.0 based on current roadmap) when everything is tested out and all confidence is held. But if you are interested in the preview, we now have an insider program. -Please answer the below two questions and send your answers to support@lextudio.com to enroll (yep, that simple), +Please answer the below two questions and send your answers to [our mailbox](mailto:support@lextudio.com) to enroll (yep, that simple), - Do you have a custom NuGet server/feed where you can host our test NuGet package for this build? - What is the lowest .NET Standard version your apps require? Is .NET Standard 1.3 OK for them? diff --git a/_posts/2017/2017-3-30-how-to-upgrade-xunit-net-projects-to-2-2-0.md b/_posts/2017/2017-3-30-how-to-upgrade-xunit-net-projects-to-2-2-0.md index e8c908cd7d3..befd12fe752 100644 --- a/_posts/2017/2017-3-30-how-to-upgrade-xunit-net-projects-to-2-2-0.md +++ b/_posts/2017/2017-3-30-how-to-upgrade-xunit-net-projects-to-2-2-0.md @@ -17,4 +17,4 @@ So what's up? Well, many small pieces. So the final project is [as below](https://github.com/lextm/obfuscar/blob/d7787fa1fe73265d3ce9400dbbe8e9148fe46924/Tests/ObfuscarTests.csproj). -Hope this can save you a few minutes when you hit the same issue. \ No newline at end of file +Hope this can save you a few minutes when you hit the same issue. diff --git a/_posts/2017/2017-4-23-who-should-be-contacted-for-php-on-iis-issues.md b/_posts/2017/2017-4-23-who-should-be-contacted-for-php-on-iis-issues.md index ea4f1addc12..f399aa1b164 100644 --- a/_posts/2017/2017-4-23-who-should-be-contacted-for-php-on-iis-issues.md +++ b/_posts/2017/2017-4-23-who-should-be-contacted-for-php-on-iis-issues.md @@ -22,5 +22,5 @@ So if you hit any issue with PHP, your very first task is to identify which proc * But if you do hit issues caused by `w3wp.exe` and `iisfcgi.dll`, you can contact [Microsoft support](https://support.microsoft.com). > Update: July 10, 2020. [Microsoft plans](https://news-web.php.net/php.internals/110907) to stop supporting PHP on Windows. - +> > Update: Oct 20, 2023. Since PHP 7.x all reached end of life, PHP on Windows/IIS is no longer supported by Microsoft (I think even if you hit issues with Microsoft components). You should switch to Linux hosting as soon as you can. For example, now if you host an PHP 8.x web app on Microsoft Azure, the underlying OS is Linux. diff --git a/_posts/2017/2017-4-24-which-class-library-project-to-go-in-visual-studio-2015-2017-2019.md b/_posts/2017/2017-4-24-which-class-library-project-to-go-in-visual-studio-2015-2017-2019.md index 760ed13ed8c..5fa85fef314 100644 --- a/_posts/2017/2017-4-24-which-class-library-project-to-go-in-visual-studio-2015-2017-2019.md +++ b/_posts/2017/2017-4-24-which-class-library-project-to-go-in-visual-studio-2015-2017-2019.md @@ -28,11 +28,13 @@ Above is a screen shot of Visual Studio 2017, which quite typically shows many o Well, many people get lost as you do, as there are so many of them. So how should we understand Microsoft's logic behind the scene? I think we can divide all of them into two categories. ## Platform Specific Class Library + Class Library (.NET Framework) has been there for long since .NET Framework 1.0. We have known its rule that any such class library can only be consumed by .NET Framework apps. Such a rule also applies to other project types, targeting iOS/tvOS/watchOS/Android/UWP. We have to rely on such class library types, as later we will see for cross platform class library types we usually cannot work against all types available on the underlying platforms. ## Cross Platform Class Library + Class Library (Portable) has been the first type of cross platform library we can use, and is also called PCL for short. It allows the code to be written against a common API set extracted from a set of platforms. Its design has many flaws, so Microsoft later introduces .NET Standard. Class Library (.NET Standard) is the new type to replace PCL. It allows developers to write code against a much larger API surface. **Thus, if you are now developing something new and would like to support many platforms, make sure you use such a project type.** @@ -44,6 +46,7 @@ Class Library (.NET Core) is so special, that your code can actually run on many Class Library (Xamarin.Forms) is similar, as Xamarin.Forms is cross platform and supports iOS/Android/UWP (WPF and macOS support is coming). If you create a project of this type, it can only be consumed by Xamarin.Forms apps. ## How to Migrate Code Among Them + So far, my personal experience is that cut and paste is the simplest and most effective way. > Note that in certain cases you can create a class library that targets multiple platforms (net452;netstandard2.0 for example). diff --git a/_posts/2017/2017-4-26-how-to-build-net-core-solutions-on-appveyor.md b/_posts/2017/2017-4-26-how-to-build-net-core-solutions-on-appveyor.md index 18d8c5e938b..c4e633adc47 100644 --- a/_posts/2017/2017-4-26-how-to-build-net-core-solutions-on-appveyor.md +++ b/_posts/2017/2017-4-26-how-to-build-net-core-solutions-on-appveyor.md @@ -11,16 +11,19 @@ I have recently upgraded #SNMP Library to .NET Core. And to the extreme, I get r ## The Whole Manifest -The whole manifest can be found here, -https://github.com/lextudio/sharpsnmplib/blob/8e1d5b7e99a9d91c20d0dccc2d339afeacd809a3/appveyor.yml + +The whole manifest can be found [here](https://github.com/lextudio/sharpsnmplib/blob/8e1d5b7e99a9d91c20d0dccc2d339afeacd809a3/appveyor.yml). ## The Image + It is very important to use Visual Studio 2017 image. It has all the development dependencies installed (Xamarin, .NET Core SDK, as well as Git and NuGet bits). ## Build Script + You cannot use the default MSBuild tasks from AppVeyor, so I suggest you use a custom script like I do. If your solution only contains .NET Core projects or .NET Framework projects, you can now even use dotnet command to perform the operations, + ``` bash dotnet restore somesolution.sln dotnet clean somesolution.sln @@ -36,6 +39,7 @@ C:\Users\lextm\Downloads\sharpsnmplib\SharpSnmpLib\SharpSnmpLib.Android.csproj(6 ``` An easy workaround is available, which I use here, + ``` bash msbuild /t:Restore somesolution.sln msbuild /t:Clean somesolution.sln @@ -43,6 +47,7 @@ msbuild somesolution.sln ``` ## Test Script + The default AppVeyor unit test runner configuration does not yet support .NET Core runners. Thus, again we have to use a custom script right now. I simply use `dotnet test` as it is the easiest. diff --git a/_posts/2017/2017-4-29-plan-for-snmp-library-vnext.md b/_posts/2017/2017-4-29-plan-for-snmp-library-vnext.md index baa0aadc4df..1d696f375b5 100644 --- a/_posts/2017/2017-4-29-plan-for-snmp-library-vnext.md +++ b/_posts/2017/2017-4-29-plan-for-snmp-library-vnext.md @@ -11,14 +11,17 @@ As .NET Core 2.0 is coming, I think it is time to write about the plan for #SNMP ## Minimal .NET Framework Version + Now the plan is to require .NET Framework 4.6.0 and above. If Microsoft does resolve multiple target framework support in .NET Standard Class Library project, then I might add back .NET Framework 4.5.x support. ## Minimal .NET Standard Version + The plan is to support .NET Standard 1.3 and above. Won't support other .NET Standard versions, as they are too limited. But since a workaround is used to run this library on .NET Standard 1.3, I might build a .NET Standard 2.0 assembly in NuGet package to remove this workaround. ## Extra Assemblies + We still need to have SharpSnmpLib.Full.dll, SharpSnmpLib.iOS.dll, and SharpSnmpLib.Android.dll, although now they only contain two classes each. This is a limitation of .NET Standard 1.3. Probably when .NET Standard 2.0 comes, we can finally have a single SharpSnmpLib.NetStandard20.dll to rule all the platforms. -Stay tuned. \ No newline at end of file +Stay tuned. diff --git a/_posts/2017/2017-5-14-the-stupid-story-of-installing-monodevelop-7.md b/_posts/2017/2017-5-14-the-stupid-story-of-installing-monodevelop-7.md index 46e34573164..1b30bb4fa0e 100644 --- a/_posts/2017/2017-5-14-the-stupid-story-of-installing-monodevelop-7.md +++ b/_posts/2017/2017-5-14-the-stupid-story-of-installing-monodevelop-7.md @@ -25,6 +25,7 @@ Then another error happened > error: runtime/org.freedesktop.Platform/x86_64/1.4 not installed So that I had to ask Google again and found this fix, + ``` bash flatpak install gnome org.freedesktop.Platform/x86_64/1.4 ``` diff --git a/_posts/2024/2024-2-9-running-go-web-apps-on-iis-with-httpplatformhandler.md b/_posts/2024/2024-2-9-running-go-web-apps-on-iis-with-httpplatformhandler.md index 498916814c6..95942c16216 100644 --- a/_posts/2024/2024-2-9-running-go-web-apps-on-iis-with-httpplatformhandler.md +++ b/_posts/2024/2024-2-9-running-go-web-apps-on-iis-with-httpplatformhandler.md @@ -22,7 +22,7 @@ To follow this post, you need to have the following software installed, At the beginning, we will start by installing Go on this machine, ``` bash -$ winget install GoLang.Go +winget install GoLang.Go ``` After that we will start to make a sample application, @@ -41,17 +41,17 @@ Next, create a file `server.go` with the following content, package main import ( - "net/http" - - "github.com/labstack/echo/v4" + "net/http" + + "github.com/labstack/echo/v4" ) func main() { - e := echo.New() - e.GET("/", func(c echo.Context) error { - return c.String(http.StatusOK, "Hello, World!") - }) - e.Logger.Fatal(e.Start(":1323")) + e := echo.New() + e.GET("/", func(c echo.Context) error { + return c.String(http.StatusOK, "Hello, World!") + }) + e.Logger.Fatal(e.Start(":1323")) } ``` @@ -79,28 +79,28 @@ To make this Go web app works with IIS, we need to modify the code a bit to read package main import ( - "flag" - "net/http" - - "github.com/labstack/echo/v4" + "flag" + "net/http" + + "github.com/labstack/echo/v4" ) func main() { - port := flag.String("port", "1323", "port to listen on") - flag.Parse() - - e := echo.New() - e.GET("/", func(c echo.Context) error { - return c.String(http.StatusOK, "Hello, World!") - }) - e.Logger.Fatal(e.Start(":" + *port)) + port := flag.String("port", "1323", "port to listen on") + flag.Parse() + + e := echo.New() + e.GET("/", func(c echo.Context) error { + return c.String(http.StatusOK, "Hello, World!") + }) + e.Logger.Fatal(e.Start(":" + *port)) } ``` Compile the code to an executable file, ``` bash -$ go build server.go +go build server.go ``` After compilation, a file `server.exe` is created in the directory. @@ -127,6 +127,7 @@ With all settings in place, I can go back to IIS Manager and create a site (I ch ## Troubleshooting ### 0x8007005 + Yeah I am not able to see "Hello, World!" but a Bad Gateway error page with the Error Code of `0x80070005`. ``` text @@ -153,11 +154,13 @@ Yeah I am not able to see "Hello, World!" but a Bad Gateway error page with the This isn't hard to understand, because anything under `C:\test-go\` is protected and not accessible by IIS application pools by default. So I need to grant read permission to the local group `IIS_IUSRS`. ### 0x8007002 + After fixing the file system permission issue, another Bad Gateway error page with the Error Code of `0x80070002` appears. The cause is actually simple, that Windows/IIS tries to resolve `server.exe` from the system path, but it is not there. So I need to modify `web.config` to use the full path or simply `.\server.exe` to make it work. ## Side Notes + So, at this very moment, the `web.config` should look like this, ``` xml diff --git a/_posts/2024/2024-3-16-pysnmp-and-home-assistant.md b/_posts/2024/2024-3-16-pysnmp-and-home-assistant.md index 0872a6a5d6f..7f37f890775 100644 --- a/_posts/2024/2024-3-16-pysnmp-and-home-assistant.md +++ b/_posts/2024/2024-3-16-pysnmp-and-home-assistant.md @@ -28,7 +28,7 @@ While our hope was that this simple change would fix the issue, it turned out th To dive deeper into the issue, we started by building a test environment with HA OS VM (2024.3.1 release) on VirtualBox/macOS on Mar 14 on which we quickly identified the WALK v2 bug and fixed in PySNMP 6.0.11. > As a sidenote, we didn't expect anyone to perform GET NEXT based WALK operations in SNMP v2c/v3, as GET BULK based WALK is more efficient, but it turned out that HA was doing that. A few unit test cases were missed in this field, but not anymore. - +> > Also note that HA OS is more end user centric, so later we have to switch to another environment setup. That's how we opened [a new issue for tracking](https://github.com/home-assistant/core/issues/113457) and [the pull request](https://github.com/home-assistant/core/pull/113463) was accepted. @@ -43,9 +43,7 @@ The problem was very strange that the first round of WALK seemed to work fine, b ## Sudden Resolution -Before we spent time investigating further the root cause of this issue, we already knew that @nmaggioni was helping to port device tracker to asyncio, - -https://github.com/home-assistant/core/pull/112815 +Before we spent time investigating further the root cause of this issue, we already knew that [@nmaggioni was helping to port device tracker to asyncio](https://github.com/home-assistant/core/pull/112815). Thus, we took a shortcut to cherry pick his changes to our fork and found that the device tracker feature started to work again. diff --git a/_posts/2024/2024-3-30-running-django-web-apps-on-iis-with-httpplatformhandler.md b/_posts/2024/2024-3-30-running-django-web-apps-on-iis-with-httpplatformhandler.md index a4f69084778..35795f19ea2 100644 --- a/_posts/2024/2024-3-30-running-django-web-apps-on-iis-with-httpplatformhandler.md +++ b/_posts/2024/2024-3-30-running-django-web-apps-on-iis-with-httpplatformhandler.md @@ -26,8 +26,8 @@ To follow this post, you need to have the following software installed, No doubt we will start from a sample application as below. ``` batch -$ cd C:\test-django -$ C:\Users\lextudio\AppData\Local\Programs\Python\Python310\python.exe -m django startproject mysite +cd C:\test-django +C:\Users\lextudio\AppData\Local\Programs\Python\Python310\python.exe -m django startproject mysite ``` This generates a Django project in `C:\test-django\mysite`, and now we can use a simple command `python.exe manage.py runserver` in the directory of `C:\test-django\mysite` can launch the application at port 8000, @@ -93,7 +93,7 @@ MEDIA_ROOT = BASE_DIR / 'media' Then, install Uvicorn and WhiteNoise. ``` batch -$ python.exe -m pip install uvicorn whitenoise +python.exe -m pip install uvicorn whitenoise ``` Finally, enable WhiteNoise in `settings.py`, @@ -113,7 +113,7 @@ STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' One extra step needed here is to move all static files to a central folder, ``` batch -$ python.exe manage.py collectstatic +python.exe manage.py collectstatic ``` > This is not only applicable to WhiteNoise, but also to other static file serving mechanisms. But you must do this step after enabling WhiteNoise in `settings.py`, as the generated files are different with and without WhiteNoise. diff --git a/_posts/2024/2024-3-31-running-next-js-web-apps-on-iis-with-httpplatformhandler.md b/_posts/2024/2024-3-31-running-next-js-web-apps-on-iis-with-httpplatformhandler.md index 063aac673b4..3918505a1ec 100644 --- a/_posts/2024/2024-3-31-running-next-js-web-apps-on-iis-with-httpplatformhandler.md +++ b/_posts/2024/2024-3-31-running-next-js-web-apps-on-iis-with-httpplatformhandler.md @@ -26,10 +26,10 @@ To follow this post, you need to have the following software installed, First, use `create-next-app` to create a new Next.js project, ``` bash -$ cd C:\ -$ mkdir test-nextjs -$ cd test-nextjs -$ npx create-next-app@latest +cd C:\ +mkdir test-nextjs +cd test-nextjs +npx create-next-app@latest ``` If you choose every option by default, you get a simple Next.js web app in `my-app` folder. @@ -84,7 +84,6 @@ If you encounter any issues, you can check the troubleshooting tips I wrote in [ ## Side Notes -### Deployment Artifacts You must run `npm run build` (wrapper over `next build`) to generate the artifacts before deploying to IIS. Besides, you can delete source files and only leave `.next`, `node_modules` and `web.config` in the deployment folder. > It is possible to delete more bits from `node_modules` to reduce the deployment size, but that's another topic. @@ -105,6 +104,7 @@ const nextConfig = { export default nextConfig; ``` + where `AppWithNode1` is the name of the IIS application. ### Next.js on IIS Express diff --git a/_posts/2024/2024-4-5-running-nest-web-apps-on-iis-with-httpplatformhandler.md b/_posts/2024/2024-4-5-running-nest-web-apps-on-iis-with-httpplatformhandler.md index a66b7186986..b03f93030fc 100644 --- a/_posts/2024/2024-4-5-running-nest-web-apps-on-iis-with-httpplatformhandler.md +++ b/_posts/2024/2024-4-5-running-nest-web-apps-on-iis-with-httpplatformhandler.md @@ -28,10 +28,10 @@ To follow this post, you need to have the following software installed, First, use `nest new` to create a new Next project, ``` bash -$ cd C:\ -$ mkdir test-nest -$ npm i -g @nestjs/cli -$ nest new project-name +cd C:\ +mkdir test-nest +npm i -g @nestjs/cli +nest new project-name ``` If you choose every option by default, you get a simple Nest web app in `project-name` folder. @@ -113,6 +113,7 @@ If you encounter any issues, you can check the troubleshooting tips I wrote in [ ## Side Notes ### Deployment Artifacts + You must run `npm run build` (wrapper over `nest build`) to generate the artifacts before deploying to IIS. Besides, you can delete source files and only leave `dist`, `node_modules` and `web.config` in the deployment folder. ### Nest on IIS Express diff --git a/_posts/2024/2024-4-8-httpplatformhandler-v2.md b/_posts/2024/2024-4-8-httpplatformhandler-v2.md index 1c242f264e1..cfd1a8551b9 100644 --- a/_posts/2024/2024-4-8-httpplatformhandler-v2.md +++ b/_posts/2024/2024-4-8-httpplatformhandler-v2.md @@ -41,6 +41,7 @@ To recap, this v2 module from us provides the following benefits, * Open-source. You can check out the source code and build it yourself. ## How to Get HttpPlatformHandler v2? + The changes we make are released under MIT, and you can check out the source code and installers on [our GitHub repository](https://github.com/lextudio/httpplatformhandlerv2/releases). The current release is marked as v2.0 RC2, as we are still testing it in various scenarios. But the module is already able to handle all the test cases my team have at hand, so we believe it's time that you try it out.