Visual Studio Code – Solution Explorer .Net Core

July 31, 2018

If you don’t want to run all the command line command of DotNet Core like here.

You can start using the Visual Studio Code for .NET Core with the VSCode Solution Explorer

image

https://marketplace.visualstudio.com/items?itemName=fernandoescolar.vscode-solution-explorer

image

 

Install and Reload

image

 

image

Go to menu VIEW => EXPLORER

image

Create a new Project file from the START page

image

You can see the command it ran, in the Debug window.

image

 

Next it it ask you to open up a TEMPLATE file in the bottom right corner

image

Click YES

It will open the TEMPLATE Window to choose from :

image

It that did not open the Template window you can trigger it manually here.

Right click on the Solution file => Add New Project

image

Follow the questions asked and it will create a new Project from the Template and Programming Language chosen.

Again the commands show up in the Debug Window

image

As you can see it created nicely the new .Net Core Project

image

 

Benefit of this extension is that you don’t need to run all the command manually.

And you don’t need to install a ton of software like Visual Studio on your machine …. Smile

image

You can also add .NET Core Test Explorer Extension to VS Code for Unit testing

image

More extensive info you can find over here

Enjoy !

Advertisements

Windows – L2TP VPN Error 789

July 27, 2018

If you encounter this Error 789 when making a new VPN connection on a Windows client.

image

9 out 10 this is the reason…

SOLUTION :

1. Go to SERVICES


2. Look for IKE and AuthIP IPsec Keying Modules

image

3. ENABLE and START the Service

4. Test the connection again

Now it will work…

Tip : Winking smile

1. If you want to Automate the L2TP VPN client config check this out

If you need to find a quick way to connect to multiple VPN connections, see here

2. If you happen to use the Watchguard MUVPN client software for IPSEC on a Windows 7, in combination with L2TP Windows VPN.

clip_image001 image

You need to DISABLE the IKE service in order to get access to all network resources.

STOPPING the Service will not help !

Enjoy!


Visual Studio Code – How to run PowerShell or AutoIT

July 25, 2018

What is Visual Studio Code (VSCode) ?

Visual Studio Code is a cross platform source code editor for Windows, Linux and macOS, that support a multitude of programming and scripting languages.

https://en.wikipedia.org/wiki/Visual_Studio_Code

 

image

 

And more using extension …

https://marketplace.visualstudio.com/vscode

image

More then 1700 extensions available, only for Code language alone …

 

Install VSCode :

https://code.visualstudio.com/download

 

VSCode Architecture ?

VS Code is fully decoupled from the specific debugger and this architecture allows VS Code to debug anything, as long as there’s a Debug Adapter available, as illustrated here:

image

 

Why using VSCode ?

If you don’t want to use the full blown Visual Studio, which is a ton of software on you computer !

But still want to have the syntax highlighting, code intellisense, and more then VSCode is the real deal for you.

Big community and training videos

https://code.visualstudio.com/community

 

Extensions ?

There are many extensions available that gives VSCode extra functionality…

On of them is running code inside VSCode, like PowerShell and AutoIT, and hundreds of many more !

So you don’t need to use the PowerShell ISE or SciTE anymore, keeping all different code development & debugging in 1 tool Smile

 

Solution :

1. install the PS Code extension:

https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell

 

2. Restart VS Code

 

3. Test a PS Script

Open a PS1 script and press F5.

image

See here for more info :

https://4sysops.com/archives/how-to-run-powershell-code-in-vscode/

 

The same goes for AutoIT Smile

1. Install the extension, this one seems to be the most extensive …

https://marketplace.visualstudio.com/items?itemName=4ern.4ern

or

https://marketplace.visualstudio.com/items?itemName=Damien.autoit

2. Restart VSCode

3. Test a au3 Script

 

Keyboard Shortcuts :

  • Run Script: F5
  • AutoIt Check: Ctrl+F5
  • Compile Script: Ctrl+F7
  • Build Script: F7
  • Run AutoIt Help: Ctrl+F1
  • Run Au3Info: Ctrl+F6
  • Debug to MsgBox: Ctrl+Shift+D
  • Debug to Console: Alt+D
  • Run Koda: Alt+M

image

 

More info on how to Configure VSCode :

https://4sysops.com/archives/vscode-as-a-console-for-powershell-core-6-part-1-multiple-shells/

 

Enjoy!


Windows IoT Core – How to Clone & Repair Your RPI3 SD Cards With Windows

July 24, 2018

A while ago I managed to corrupt my SD card that was holding my Windows IoT Core and all the apps running Sad smile

I lost some of my work and had to redo a brand new installation on a new SD card !

So I went to look on how to prevent this from happening in the future.

SOLUTION :

Download the Win32 Imager from Sourceforge

image

Cloning the SD Card With Windows

1. Install the application

2. Make an image to your local machine

image

Wait for the imaging of the SD card to be completed. There is a progress bar that will give you an idea as to how long this will take.

Done !

Restoring an SD Card From a Clone

Clean you SD card first to regain all the capacity :

1. First format the DS Card

image

2. Next regain all the unallocated space using these steps :

Open cmd prompt with Admin priviliges and run these commands :

=> DISKPART

image

=>  SELECT DISK 1 (if this is your SD Card !)

image

=> CLEAN

image

To zero out all data on the SD card you could use “clean all” instead

=> CREATE PRIMARY PARTITION

image

Check again using the Disk Manager you should now have all the capacity back Winking smile

image

If this did not work best check the alternatives here :

https://www.easeus.com/partition-master/diskpart-cannot-clean-disk-usb-sd.html

Restore using Win32 Imager

Select the previously saved image and press WRITE

image

image

Watch the progress bar and check the result …

Enjoy!


Windows Core IoT – Stop Cortana process

July 21, 2018

When running the latest version of Windows IoT, it will install the Cortana service as well …

Which can take quite some unnecessary memory and CPU from your little RPI3 Sad smile

This way you can find out how to stop it manually, because there is no way you can do it at boot time ?

When starting Windows IoT you can see the Cortana process is running :

image

If you select STOP you notice it doesn’t stop from the first time ?

You need to repeat it multiple times….

Uninstalling did not work, IoT crashed afterwards and stopped working.

Let’s see if we can find a different way ?

We will make use of some command line tools, see here :

First lets list all processes using TLIST.EXE

image

You will notice you won’t find anything related to Cortana at first sight…

Let’s run TLIST.EXE –v

image

Just like to the full Windows 10 you find out that SearchUI.exe is hosting the Cortana process.

Let’s try to kill it now using the KILL.EXE command :

image

Using the Process ID or the Process Name …

Indeed the process stopped immediately.

image

I noticed that after a while the process starts again automatically ?

So now we can quickly kill it again when needed.

Enjoy !


Windows Core IoT – Wifi Issues on a RPI3

July 14, 2018

After I upgrade Windows IoT on my RPI3 to a later version….

I had 2 major issues Sad smile

1. After Upgrading Windows IoT was not booting

   Because of a failed upgrade …

   And my SD card got in a Locked state … This means I could not even format it anymore

   Tried every trick in the book (even formatting using a smartphone) but no success.

   The SD card was down the drain.

    Later on I will write an article on how to make an image of your Windows Core IoT…

    So you don’t loose all your work Winking smile

2. WIFI got very unstable

    After starting with a new Windows Core IoT installation,  it got connected but then lost connection.

    Very annoying !

    The build I was using was v.10.0.17134.

After searching the internet I found many more users experiencing…

SOLUTION :

One solution / workaround I found was this :

1. Connect your RPI3 using a network cable and start Windows Core IoT

2. next go to the Web Portal interface using your IP:8080

3. Delete You WIFI Profile, and create a new one and save it again.

image

If not stable repeat this again …

If still you experience problems investigate the WIFI Device Error Code here :

Go to Devices

-> ACPI ARM-based PC

-> Microsoft ACPI-Compliant System

-> Broadcom 2836 Arasan SD Host Controller

-> Broadcom 802.11n Wireless SDIO Adapter

image

image

If you see code 23 or 24 your SD card is not OK Sad smile Try a faster SD card Type.

Mine was OK but still WIFI issues …

So again I tried to install the latest Windows updates (but first made an image of my prior installation)

image

Now I am on version 10.0.17134.165

image

And all is running stable again Smile

You can check the WIFI performance like this …

netsh wlan show interfaces

image

As you know the RPI3 B model has weak WIFI throughput compared to the new B+  Model.

But unfortunately there is no Windows Core IoT driver available yet ? Sad smile

Enjoy !


Windows Server 2016 – Performance data for this service will not be available Event ID 1008

July 10, 2018

How to solve the Event ID 1008.

image

SOLUTION :

Run these commands using Admin Privileges :

image

C:\Windows\system32\lodctr.exe /R

C:\Windows\SysWOW64\lodctr.exe /R

C:\Windows\System32\wbem\winmgmt.exe /RESYNCPERF

C:\Windows\SysWOW64\wbem\winmgmt.exe /RESYNCPERF

After running these commands you might get the Event ID 2003

image

To solve this run this command using Admin Privileges :

lodctr /T:TermService

See here for more options :

https://partnersupport.microsoft.com/en-us/par_servplat/forum/par_winserv/top-issue-error-1008-from-perflib-open-procedure/2104e9f9-62c3-40e1-9bfe-a04027149f04

https://www.admin-enclave.com/en/articles/windows/306-resolved-the-open-procedure-for-service-bits-in-dll-c-windows-system32-bitsperf-dll-failed-performance-data-for-this-service-will-not-be-available-the-first-four-bytes-dword-of-the-data-section-contains-the-error-code.html

Enjoy !