Skip to content

Fixed DataSource deserialization. #859

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions scripts/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,25 @@ function Print-Help {
Exit 0
}

function Install-WindowsSDK {
Push-Location
$temp = [System.IO.Path]::GetTempFileName();
Remove-Item $temp
New-Item $temp -Type Directory | Out-Null
Set-Location $temp

try {
Invoke-WebRequest -Method Get -Uri https://go.microsoft.com/fwlink/p/?LinkId=838916 -OutFile sdksetup.exe -UseBasicParsing
Start-Process -Wait sdksetup.exe -ArgumentList "/q", "/norestart", "/ceip off", "/features OptionId.WindowsSoftwareDevelopmentKit" -Wait -PassThru
}
finally {
Pop-Location

Remove-Item $temp -Force -Recurse | Out-Null
}

}

#
# Restores packages for the solutions.
#
Expand Down Expand Up @@ -285,6 +304,10 @@ if (ShouldRunStep @("UpdateTPVersion")) {
Sync-PackageVersions
}

if (ShouldRunStep @("Install-WindowsSDK")) {
Install-WindowsSDK
}

if (ShouldRunStep @("UpdateTPVersion", "Restore")) {
Perform-Restore
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,18 @@ public static object[] Deserialize(string[] serializedData, params Assembly[] as
for (int i = 0; i < length; i++)
{
var typeIndex = i * 2;
var dataIndex = typeIndex + 1;
var typeName = serializedData[typeIndex];
var serializedValue = serializedData[typeIndex + 1];

if (serializedData[i] == null)
if (serializedValue == null || typeName == null)
{
data[i] = null;
continue;
}

var typeName = serializedData[typeIndex];
var serializer = GetSerializer(typeName, assemblies);

var serialzedDataBytes = Encoding.UTF8.GetBytes(serializedData[dataIndex]);
var serialzedDataBytes = Encoding.UTF8.GetBytes(serializedValue);
using (var memoryStream = new MemoryStream(serialzedDataBytes))
{
data[i] = serializer.ReadObject(memoryStream);
Expand Down