Windows 10 – Running ASP.NET Core 2.0 on Mono

August 5, 2018

After installing Mono on Ubuntu using Windows 10 WSL, see here

You can start cross compiling you ASP .NET Core 2.0 Apps to run on Mono

1. Publush for Linux

Use this command : dotnet publish -r linux-x64 -c Release

image

2. Install DotNet Core on Ubuntu :

First in widows go to the project folder where you find the published project see step 1.

image

And start the WSL there. Open command prompt in that folder and run BASH

image

Run these commands to install .Net Core Framework on Mono :

curl https://packages.microsoft.com/keys/microsoft.asc | gpg –dearmor > microsoft.gpg

sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg

sudo sh -c ‘echo “deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main” > /etc/apt/sources.list.d/dotnetdev.list’

sudo apt-get update

sudo apt-get install dotnet-sdk-2.1.3

3. Install and Configure Web Server Nginx

sudo apt-get install nginx

It runs on PORT 80 by default, so stop other windows webservers if needed.

image

next run this command :

sudo service nginx start

And test it by opening a browser in windows, you should see this webpage.

clip_image002

To stop the webserver run :

sudo service nginx stop

4. Configure nginx as reverse proxy server

Go in Windows to the Linux installation folder …

Open the file in Notepad++ and make the make the following changes in the DEFAULT file:

clip_image002[6]

C:\Users\xxxx\AppData\Local\lxss\rootfs\etc\nginx\sites-available

Change the default port from 80 to whatever you like, example 81

Comment out this line : #try_files $uri $uri/ =404;

Add this line proxy_pass line : proxy_pass http://localhost:5000;

image

You can also use the VI editor in Linux if you like this :

sudo vi /etc/nginx/sites-available/default

Now test the config changes are working :

sudo nginx -t

If you did not stop the server you can do a reload :

sudo nginx -s reload

6. Test the .Net Core App in WSL using Bash

Open Bash in the Published folder

clip_image002[8]

And TEST the Linux .Net Core application like this :

dotnet FirstMvc.dll

image

I get an error because the Linux is CASE Sensitive. So try again using the correct command.

And the SQL Database location is not found.

Because I started it not from the default folder location, which should be C:\CoreIoT\ASPnetRazorSQLiteWsAPI\Data

image

But all runs well, so the .NET Core App is a try cross platfrom framework Smile

Enjoy!

Advertisements

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 !


Windows 10 – High Harddisk activity on wiatrace.log

March 11, 2018

You  may notice a high HD activity writing to the wiatrace.log file.

WIA stands for Windows Image Acquisition Library.

This is used if you have a Printer scanner installed. Even if you don’t use the Scanner the log file writes debug info to it.

SOLUTION :

Open the registry and go to :

HKLM\System\CurrentControlSet\Control\StillImage\Trace\wiaservc.dll

image

Change the value to of TRACEFLAGS from 407 to 0

Check the disk activity again, it should be gone now Smile

Enjoy !


PowerShell – Using PoSH SSH Module to access Raspberry Pi3

October 22, 2017

You can use PuTTY to access the RPI3

image

image

Or you can use the PoSH-SSH module to do the same.

So let’s give it a try :

If you connect using this command

New-SSHSession -ComputerName  YourRPI3

Don’t use a domain notification for the user, but just the user name.

image

image

But further then this you can’t get … in this version of PoSH-SSH, so best use the famous PuTTY tool to connect.


Xperia Z3 Compact GPS Not Working

May 2, 2017

We encountered a Sony Mobile where the GPS was not working suddenly ?

So I was thinking that a recent software update was the root cause…

Next I went on the Forum to see if there are where more issues like that… and indeed quite a lot found Confused smile

Solution :

Go into service mode by just dialing : *#*#7378423#*#* and then into Service Tests, GPS, Purge

See steps described on the Forum GPS not working,

image

But still it did not work ! Sad smile

This simple setting fixed it !

Go to Location Settings :

Go to MODE and change to HIGH ACCURARY

image

image

Problem Fixed… Smile


Windows Core IoT – Accessing a DotNet DLL assembly on a Raspberry PI3 using Windows Core IoT

January 23, 2017

In this post I showed how to create an Console app using my Visual Studio Light for ARM, to run on a Raspberry PI3 on Windows Core IoT.

Taking it one step further is that you access an DotNet Assembly that was created before, and seem to run as well on X86 as on ARM Smile

So most Assembly DLL’s seem to be architecture independend …

 

image

 

Let’s see here :

Using ILSpy you can see the source of the self made .NET Assembly.

image

 

image

I copied the DLL Assembly to the RPI3, did a remote access from PS IDE and ran the following code.

image

 

As you can see it ran without any issues ! the result was returned as expected … Smile

Enjoy !


Fiddler – How to capture non Web Browser traffic

March 21, 2016

I had a need to debug an external app using fiddler.

Seems to be a trivial exercise, but I could not see the captured traffic in fiddler ?

After Googling a bit, I could only find part of the solution.

Below is the full story.

Solution :

1. Proxy Settings : First of all you need to know that Fiddler acts as a proxy server on your machine when you start it.

The default address / port is 127.0.0.1:8888

You can check the settings after starting Fiddler in you Browser settings.

image

So you need to set the proxy settings in your local application that you want to test.

2. Decrypt HTTPS settings

Make sure you have set to Decrypt HTTPS

image

image

This needs a extra extension to Fiddler (which is not installed by default)

3. Capture all Processes

After that you need to make sure that you tell Fiddler to capture all traffic for all Processes.

image

This last step I overlooked for a few hours before my eyes caught the option menu at the bottom.

Enjoy Winking smile