Categories: Uncategorized

Roslyn access denied error

Publishing a .NET 4.5 site on a normal provider, not Azure, i got the yellow screen of death “Access is denied” with “Cannot execute a program. The command being executed was \roslyn\csc.exe”.
Since the .NET 4.5 , Roslyn is the default compiler; Roslyn is interesting (even if i wrote code that was evaluating C# code years ago using Reflection) but i was in a hurry, i was needing to make the site working ASAP.
The quick & dirty solution is to delete from web.config the system.codedom section.

Categories: .NET, Vs2015

Testing problems with SharePoint 365

I was trying to develop an Add-in on SharePoint online, the version that comes with Office365, after a long experience with SharePoint on premise.
The first thing I tried was the obvious HelloWorld in Vs2015:

specifying a hosted version:


Some changes to code, and immediately tried to launch with F5…error!:

error occurred in deployment step 'install sharepoint add-in' sideloading is not enabled

Ok, the story is : The site collection should be based on “Developer Site” template or you have to enable sideloading feature.
Sideloading apps is not secure.
The main reason for blocking sideloading by default on non-developer sites is the risk that faulty apps pose to their host.
Apps have the potential to damage site collections.
Then apps should be sideloaded only in dev/test environments, never in production.
Anyway is faster to immediately try our code, so the first thing is to download and install the SharePoint Online Management Shell.
Done this, we can download the PowerShell scripts from here.
These scripts must be changed in the initial part, where are provided url, user, password; you can press Return for the questions so are used the cabled values:

if ($siteurl -eq '') {
    $siteurl = 'https://yourtenant.sharepoint.com'
    $username = 'user@yourtenant.onmicrosoft.com'
    $password = ConvertTo-SecureString -String '<yourpwd>' -AsPlainText -Force

Launched from the SharePoint Online Powershell, another error….:

Error encountered when trying to enable SideLoading feature https://******.sharepoint.com : Exception calling "ExecuteQuery" with "0" argument(s): "For security reasons DTD is
prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method."

I tried to launch in Powershell

set-ExecutionPolicy Unrestricted

But still the error, and probably is not requested: i was staring at the screen, thinking to return to my ancient job as plumber (yes.. when i was very young, MS-DOS was recently commissioned from IBM to Bill Gates while i was trying to make some money for the motorcycle).

After some searches i found the incredible solution: it seems that the “DTD is prohibited..” is related to a DNS problem in order to reach your tenant; so the solution is to use the Google DNS couple in your pc network setting:

So, the Powershell activation was now running ok:

And magically , launching with F5:

Categories: Office365, SharePoint

Passed Microsoft Exam 70-480 Programming in HTML5 with JavaScript and CSS3

More easy than the previous, the hardest part were the questions about CSS3.

Categories: HTML5

Vb6 software on Azure VM

There are still customers that uses old, aged software: for example, i have customers using my old program for truck transports, that uses a Microsoft Access file as database.
As i wrote in this post, this software in installed on a on-premise server, which was tipically Windows server 2003.
Now, these old servers (often recycled) are dying, the hardware today is more cheaper than in the past but an Windows Server 2012 license is still expensive for a small office.
So the idea: let’s try to migrate to Azure!
So i began an incredible amount of try & catch (errors..)
The application requires to send emails via CDO , with an attached pdf file generated from the Crystal Reports engine (used from the app for the printing activities).
In order to print via CDO is required a working email client; in the old Windows 2003 there was by default Outlook Express, instead from 2008 version in Windows Server there is no more an email client: this can be resolved installing Windows Mail, but it requires .NET 3.5
First error: using an Windows Server 2012 DataCenter NOT R2.
The main problem with the “normal” version is, IMHE (In My Humble Experience) that .NET 3.5 is not installable because you can’t use the downloadable 3.5 installer and this must be done from the Server Manager that complains about missing sources (for example see here, but i was not able to achieve the same result) : could be that attaching an ISO file (of Windows Server 2012) it works.
But i lose no more time and try creating instead an Windows Server 2012 R2 vm: same complain about the missing sources, but this time .NET 3.5 installed without issues.
The installation of Windows Mail was without problems and so for my app.
The only problem is the calendar for date input: my vb6 app uses mscal.ocx (perhaps a wrong choice) which is problematic.
For example in the setup.lst file generated from the vb6 package installer wizard the mscal is generated as

File10=@MSCAL.OCX,$(WinSysPath),$(DLLSelfRegisterEx),$(Shared),5/7/98 12:00:00 AM,90112,

But the DLLSelfRegisterEx must be changed in DLLSelfRegister otherwise the setup is not successful.
And in every case the problem is that the calendar was not displayed (interface in Italian):

The solution was to recreate from scratch the VM and create an vb6 installer WITHOUT mscal.ocx: it is already present in the Azure vm and trying to install another mscal.ocx causes big troubles in the registry; now the mscal.ocx is working ok.
Another curious thing was that in the vb6 code

With Flds
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = boolUseSsl
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = intSmtpAuth
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = strUser
    .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = strPwd
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmtpSvr
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = intSendUsing
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = intSvrPort
End With

“microsoft” was accidentally written with the initial “m” uppercase, so the email sending was not working in the new 2012 R2 server (instead in Windows Server 2003 yes!); after the correction, emails sent.

Autostart of RabbitMQ service in Ubuntu

I have configured a high availability cluster of RabbitMQ instances, on Azure with 2 Ubuntu LTS 16.04 servers.
With an automation runbook these 2 servers are configured for the shutdown at night, and start on morning.
I was believing that the RabbitMQ service was starting by default as in Windows: but the servers was started, RabbitMQ no.
I was working with Unix systems many years ago, so i’m not so expert and could be that there is a better approach, but i found an working solution.
Typically an Unix user at the login runs the commands listed in the $HOME/.profile file, but this works just only when the user makes an login: in practice .profile act as the auto starting profile commands of today Windows server.
In order to automatically start something at the boot as an Windows service (or the autoexec.bat of the long gone ’80s MSDOS days) the file to change is /etc/rc.sysinit
The user configured while creating the Ubuntu machine is not a super user, so using the good old vi for rc.sysinit editing the command line is

sudo service rabbitmq-server start

in a cluster this must be done on the main cluster node, if you then connect via putty to other nodes you will find the file already changed.
(esc wq! … how many times i launched this sequence in ’80s..)
Rebooting all the vm RabbitMQ is immediately working.

Categories: Azure, RabbitMQ, Ubuntu

Passed Microsoft Exam 70-532 Developing Microsoft Azure Solutions

Today i got certified for 70-532 Developing Microsoft Azure Solutions.
The exam is not easy: on the Internet you can find various sources each promising exam dumps and so on (it seems that is sufficient to memorize questions and answers…), but this morning i fighted against questions absolutely new: difficult if you don’t know very well Azure DevOps and relative programming.

Categories: Azure

Android 6.01 on Samsung S5

Finally the new Android release on my Tim phone.
Better interface with the new rounded icons, the only problem was TomTom not starting, blocked on “Loading app”: after an uninstall and then reinstall all ok.
Update 07/28: everything seems ok, also the mirrorlink connection to my car stereo Kenwood DDX7015BT.

Categories: Android

Delete Azure AD

I had created an AD directory named alextestad in my Azure subscription in order to do some experiments, after that i tried to delete this temp AD, but i received

After some struggle i found how to do.
First must be added an Global admin user to this AD, in my case I added a user named “tobedeleted”

Clicking on create you get a temporary password:

At this point using another browser in a new Private window point to https://manage.windowsazure.com and login with the new account:

And immediately is requested to change the password:

At this point by clicking the button the login is done, obviously there is no subscription

but is not important.
At this point we need to install 2 things on our pc (found info here):
Microsoft Online Services Sign-In Assistant for IT Professionals RTW
Azure Active Directory Module for Windows PowerShell (64 bit)
Done this in the Azure Powershell we can launch

$objCred = get-credential

This causes the request of login where we use the credentials of the new user:

and then

connect-msolservice -credential $objCred

done this , we can launch in Powershell

Get-MsolServicePrincipal | Select DisplayName

This instructions lists all the applications Service Principals in AD, in my case

Now we can delete all not required apps in AD tenant

Get-MsolServicePrincipal | Remove-MsolServicePrincipal

where I got some errors but it seems no problem

Reissuing Get-MsolServicePrincipal | Select DisplayName in my case we had

Now in Azure portal is needed to delete the temp user, with the DELETE button at the end of this page

Done this, finally no errors while trying to delete the AD:

Categories: Azure