Skip to main content

Posts

Showing posts from August, 2019

The quickest, easiest way to make and connect to an Azure VM

Connect-AzureRmAccount
$creds = Get-Credential
$vmname = "TestVM"
$vm = New-AzureRmVm -Name $vmname -Credential $creds #-Size "Standard_DS3_v2"
$fqdn = $vm.FullyQualifiedDomainName;
$username = $creds.UserName;
"full address:s:$fqdn" | out-file "~\desktop\$vmname.rdp";
"username:s:$vmname\$username" | out-file "~\desktop\$vmname.rdp" -Append;

Recurring issues in Visual Studio projects

Common issues and solutions to errors I come across in Visual Studio on a semi-regular basis:

Problem:
"Could not find a part of the path … bin\roslyn\csc.exe"
Solution:
Run this in Package Manager Console:
Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -r

Problem:
"Creation of the virtual directory http://localhost:12345/ failed with the error: Cannot create the Web site"
Solution:
Update .csproj file and set the following:
<UseIISExpress>true</UseIISExpress>
In the <VisualStudio> element, set the following:
<IISUrl>http://localhost:1234</IISUrl>

Problem:
"Could not load file or assembly [assembly name] or one of its dependencies. The located assembly's manifest definition does not match the assembly reference"
Solution:
If it's a nuget package, check version of the assembly in packages.config, web.config and "References" section in solution explorer, one of them is probably wrong. Try reinstal…