Posts

;VS2017.15.8.4 Error fixed

Image
Recently, I am a bit of fear to upgrade VS2017. Especially a major version was changed that every time will occur some error after installed. This time I  upgrade it from 15.7.x to 15.8.4.As expected all of my projects cannot be loaded.


Workaground According to the message I head to the developer forum where I found the answer as below:

1. Run as administrator to open Developer Command.
2.Enter the following commands. gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Build.Framework.dll" gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Build.dll" gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Build.Engine.dll" gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Build.Conversion.Core.dll" gacutil /i "C:\Program Files (x86)\Microsoft Visual …

SQL Server pass parameter to Procedure

Today, My colleague mention his work which how to pass the parameter to the procedure. The workaround as below:
1.Declare a custom table type CREATETYPEdbo.USER_TABLE_TYPE ASTABLE(        USER_NOVARCHAR(8) )
2.C# Declare DataTable and SqlParameter vartable =newDataTable();             table.Columns.Add(newDataColumn("USER_NO", System.Type.GetType("System.String")));             table.Rows.Add(table.NewRow());             table.Rows[0]["USER_NO"] ="Abc"; varpar =newSqlParameter             {                 ParameterName ="userTable",                 Value = table,                 SqlDbType = SqlDbType.Structured,                 TypeName ="dbo.USER_TABLE_TYPE"             };
3.Declare parameter which type is just created CREATEPROCEDUREdbo.GetUsers        @userTable USER_TABLE_TYPE READONLY AS BEGIN SELECT*FROM@userTable

IIS Block IP Setting

Image
We have two Web Server one for internal another for external. Now we consider let two into one. The main site will be opened a limited specific IP range, but some of the other sites will be opened to the public.

How to
1.Add Features- IP and Domain Restriction
After installed, It will show the icon in the root or subsites. 2.Setting IIS Root access from Allow to Deny.
3.IIS Root against specific IP range to open.e.g.The mask of the example as 255.255.255.0 it means from192.168.2.0~255 can be accessed.

4.Opening to the public by specific sites. Due to IIS Root has setting the deny. All of the sites will inherit this setting. After subsite modify its settings then it will base on a subsite. Therefore, it can be satisfied our request the deny is default but some allow.
All of the settings are stored in the IIS config file. %windir%\System32\inetsrv\config\applicationHost.config
Above-mentioned, all of the settings processes also can be executed by Powershell. $value=@{allowed="true&qu…

Jenkins- PowerShell include global config

Image
We have a PowerShell-script that will be referenced in many jobs at Jenkins.e.g. Retrieving a DataTable from the database. It will hard to maintain if this script in individual jobs. For this issue, I found a plugin can solve it
How to setup 1.Install plugin-Managed Scripts
2.Jenkins Management,Enter the link of Managed files.

3.Add a new Config Name:For identification。Content:Execute Script
Way to use

1.Including the config which we just add it before.,Target:Output folder
2.Executing Power Shell Import-Module the config file in the output folder and call its function to get the count of records by SQL


Reference Managed Script Plugin https://wiki.jenkins.io/display/JENKINS/Managed+Script+Plugin Power Shell Sql Query

http://mattslay.com/sql-server-queries-using-powershell-lesson-1/

VS2017-Build fail-FindDependenciesOfExternallyResolvedReferences

Image
Recently, After installed the newest version of Visual Studio 2017 that occurred some of the following error messages:

Software Infomation:Visual Studio 2017 Enterprise 15.7.4  (The problem since 15.6.x)

Workaround
I asked the help from forums the got temporary workaround as below:

Opening file: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets
Finding the red block highlight at below photo then remove it from the file.
Reference

https://developercommunity.visualstudio.com/content/problem/208668/the-finddependenciesofexternallyresolvedreferences.html

Jenkins-out of memory

Image
Sometime, It will occur error while CI do a build job.As the following message.
jenkins java.lang.OutOfMemoryError: Java heap space
Before, when it occurred.I always thought that was the Java environment problem.Therefore my workaround is restart service.

Honestly, I am not understanding Jenkins enough, a little bit lazy myself and so not seriously to find the answer.
Workaround

The default RAM setting is 256MB which can be found in the setup directory "jenkins.xml".As below image, I modify the value to 1024MB.

Reference https://stackoverflow.com/questions/5936519/how-to-give-jenkins-more-heap-space-when-it%C2%B4s-started-as-a-service-under-windows

VS2017 Msbuild Framework Error

Image
Issue After reinstalling my laptop, My web project that originally normal cannot be deployed.It shows errors Could not load file or assembly "Microsoft.Build.Framework".