Microsoft dotNet

ShortUrl

ShortUrl

Short url generator with no database required. Install this as a site.

Language: C#
Platform: ASP.Net 4.0

Source files available at https://github.com/scegg/ShortUrl/.

License: MIT

dotNet Standard sucks…

While you using netstandard to write a solution about type, assembly, roslyn and so on, you will find there is no standard at all.

netstandard is not a standard of dotnet. It’s just another standard with all others.

Web Deploy for Visual Studio

While I’m trying to deploy my site from Visual Studio to a Windows Server 2012 R2 instance, I have to dig a lot for troubleshooting about Web Deploy related problems.

 

Here are some not listed in Microsoft documents:

  • Visual Studio need both Web Deploy (Web Deployment Agent Service, MsDepSvc) and Web Management Service (WMSVC).
  • You cannot install Web Management Service separately.
  • The easy way to install the both is choose “Web Deploy 3.6 for Hosting Servers” Web Platform Installer.
  • If you selected “Web Deploy 3.6” in another release, without “for Hosting Servers”, Web Management Service will not be installed.
  • If you leave Web Deploy installed without Web Management Service, you could add it by install “Web Deploy 3.6 for Hosting Servers” but IT WILL NEVER WORK! You have to UNINSTALL existed Web Deploy first and then reinstall the “Web Deploy 3.6 for Hosting Servers”.

.NET Core 1.0.0 VS 2015 Tooling Preview 2 failed to setup due to VS2015 Update 3 related issue

20160804135826

Due to some reason unknown, Setup of Microsoft .Net Core 1.0.0 VS 2015 Tooling Preview 2 may not started with error about VS 2015 Update 3, even Update 3 is installed well.

Luckily, we can pass the check by using command parameter SKIP_VSU_CHECK=1

20160804135843

Do remember to start cmd with admin privilege, or you will see this error.

20160804135850

Div dynamic loading is not supported in Windows IoT (yet?)

Hi. I built an ASP.net side powered by SignalR recently. The function is easy that dynamically load from a URL provided from SignalR into a div from browser side. It works like a charm in IE, Edge and Chrome. The JavaScript written in the web page is simple:

  • SignalR 2.2.0 and jQuery 2.2.3 are selected;
  • Connect SignalR at beginning;
  • When SignalR disconnected, reconnect;
  • When SignalR event raised, call one method to pull the data from URL specified and set as content of a div; and,
  • Call the method mentioned above at beginning to load the initialization data.

Then, I need to do the same thing in one Raspberry Pi 3. I choose Windows IoT with UWP to build the basis. UWP app is quite easy, only one WebView control is embedded with the starting URL set to the page of that ASP.net website. According to only Insider Preview version can support Raspberry Pi 3, build 14295 is selected, which is the latest one can be found from official site.

After this app deployed and started in Raspberry Pi 3, it acts quite different. The initialization data is shown without any problem. But no more SignalR event is proceeded. By debugging on the server side, SignalR OnConnected, OnDisconnected and OnReconnected are called repeatedly and frequently.

Due to no more information can be grabbed from app running in Raspberry Pi 3, I have no clue at first. The good thing is I made a similar solution before. The only difference between these 2 apps, is the previous one use iframe instead of div. Despite of no reason observed, after I change the div into iframe and make the data surrounded by html and body tags which filling div previously , the problem vanishes away.

UWP Developing: Don’t forget the firewall on IoT devices

After I deploy my UDP based application to Raspberry Pi 2 running Windows IoT 10.0.10586, this application receives nothing, just like running in a normal Windows computer.

I guess that maybe something related to firewall, but:
1 There is no article related to target that. As the time I’m writing this post, googling “Windows IoT firewall” returns nothing related.
2 There is no page for firewall configuration in Windows IoT utilities site.

Fortunately, a test proved that there is a built in Windows IoT.
By using PowerShell connection, I send the netsh command to create an exception of firewall. It accepted and the my application started to receive package after then.

Related command for reference:
netsh advfirewall firewall add rule name=”A name for this exception” dir=in action=allow protocol=UDP localport=12345

Hope this helps.

UWP Developing: Local network protocal stack issue

I’m working on developing a Universal Windows App (Windows 10 IoT) recently. My app includes a UDP server for receiving packages.

The issue I found is:
When the UWP running on local computer, the datagram sent by local console application cannot be received.

Normally, while developing a socket based network application, another application for making and sending test packages should be prepared. The problem is, for testing UWP application, either the tester should be prepared as UWP application, or this tester can only be used on another computer laying on the same network.