Tuesday 4 October 2022

Trial period reset of Visual Studio Community Edition 2017, 2019

Trial period reset of Visual Studio Community Edition 2017 , 2019


Download Source code (zip) from this Link : https://github.com/1Dimitri/VSCELicense/releases/tag/1.0

  1. Run PowerShell.exe as an Administrator

  2. Import module:

Import-Module -Name E:\vs2019\VSCELicense


For Visual Studio Community Edition 2019


Get Visual Studio Community Edition license expiration date

Get-VSCELicenseExpirationDate -Version VS2019

Set license expiration date to current date + 30 days


Set-VSCELicenseExpirationDate -Version VS2019 -AddDays 30


For Visual Studio Community Edition 2017


Get Visual Studio Community Edition license expiration date

Get-VSCELicenseExpirationDate -Version VS2017

Set license expiration date to current date + 30 days


Set-VSCELicenseExpirationDate -Version VS2017 -AddDays 30


Wednesday 7 September 2022

Add DLL to SharePoint bin folder

Add DLL to SharePoint bin folder

 I have done this before for some sharepoint 2013 webparts projects and when googling I found this article, there it is explained how to sign third party assemblies with strong name. Basically you disassemble the dll first with ILDASM.exe and then you reassemble with ILASM.exe providing a *.snk file previously done with sn.exe. All this is explained in detail in the given article.

https://docs.microsoft.com/en-us/archive/blogs/miah/how-to-assign-a-strong-name-to-an-unsigned-3rd-party-assembly

How to sign a .NET Assembly DLL file with a Strong Name

 How to sign a .NET Assembly DLL file with a Strong Name 

.NET Assembly DLL file can be sign with strong name if it is no sign by using ILDASM and ILASM

Create strong name file.

C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools

sn -k sgKey.snk


(Dis)assemble a dll using the Visual Studio command prompt


ildasm directory\myLibrary.dll output:directory\MyLibrary.il

Assemble a dll using the Visual Studio command prompt

ilasm c:\myLibrary.il /dll /key=C:\MessageIntegrity.snk /output:C:\myLibrary.dll


another example :
> ildasm /all /out=MYASSEMBLY.il MYASSEMBLY.dll
> ilasm /dll /key=key.snk MYASSEMBLY.il






Create a strong name key (snk) file

 

Create a strong name key (snk) file


Click Start, point to Programs, point to Microsoft Visual Studio 2019, point to Visual Studio Tools, and then click Visual Studio Command Prompt (2019).

  • At the command prompt, navigate to the location where you want to create the key file. For example, type cd C:\Sample, and then press ENTER.

  • At the command prompt, type sn -k <key file name>.snk, and then press ENTER.

  • At the command prompt, type exit, and then press ENTER.

Wednesday 31 August 2022

Calculate drive space using powershell

Following command use to calculate drive available space 

 Get-WmiObject -Class Win32_logicaldisk -Filter "DriveType = '3'" | 

Select-Object -Property DeviceID, DriveType, VolumeName, 

@{L='AvailableSpace';E={"{0:N2}" -f ($_.FreeSpace /1GB)}},

@{L="TotalDiskSize";E={"{0:N2}" -f ($_.Size/1GB)}}