Skip to content
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

Update references: Microsoft.Data.SqlClient and System.Drawing.Common #1100

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
10 changes: 6 additions & 4 deletions dotnet/src/dotnetcore/GxClasses/GxClasses.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<Compile Include="..\..\dotnetframework\GxClasses\Model\URLRouter.cs" Link="Model\URLRouter.cs" />
<Compile Include="..\..\dotnetframework\GxClasses\Model\SdtGridState.cs" Link="Model\SdtGridState.cs" />
<Compile Include="..\..\dotnetframework\GxClasses\Model\SdtGridState_InputValuesItem.cs" Link="Model\SdtGridState_InputValuesItem.cs" />
<Compile Include="..\..\dotnetframework\GxClasses\Printer\GxPrinterDevice.cs" Link="Printer\GxPrinterDevice.cs" />
<Compile Include="..\..\dotnetframework\GxClasses\Security\WebSecurity.cs" Link="Security\WebSecurity.cs" />
<Compile Include="..\..\dotnetframework\GxClasses\Services\Caching\GxCache.cs" Link="Services\Caching\GxCache.cs" />
<Compile Include="..\..\dotnetframework\GxClasses\Domain\GxCollections.cs" Link="Domain\GxCollections.cs" />
Expand Down Expand Up @@ -150,7 +151,7 @@
<ItemGroup>
<PackageReference Include="Experimental.System.Messaging.Signed" Version="1.0.0" />
<PackageReference Include="log4net" Version="2.0.15" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="2.1.7" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.6" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="3.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.DotNet.Analyzers.Compatibility" Version="0.2.12-alpha">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -164,16 +165,17 @@
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.7.0" PrivateAssets="All" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.0" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<PackageReference Include="MySqlConnector" Version="2.2.3" PrivateAssets="All"/>
<PackageReference Include="MySqlConnector" Version="2.2.3" PrivateAssets="All" />
<PackageReference Include="NetTopologySuite" Version="2.0.0" />
<PackageReference Include="NodaTime" Version="3.1.9" />
<PackageReference Include="Novell.Directory.Ldap.NETStandard" Version="3.3.1" />
<PackageReference Include="Npgsql" Version="8.0.3" PrivateAssets="All"/>
<PackageReference Include="Npgsql" Version="8.0.3" PrivateAssets="All" />
<PackageReference Include="Sandwych.GeographicLib" Version="1.49.3" />
<PackageReference Include="Stubble.Core" Version="1.8.4" />
<PackageReference Include="System.DirectoryServices" Version="4.7.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.35.0" />
<PackageReference Include="System.Drawing.Common" Version="4.7.2" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
<PackageReference Include="GeneXus.Drawing.Common" Version="2.0.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.35.0" />
<PackageReference Include="NUglify" Version="1.16.4" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.3" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="2.1.7" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.6" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="8.0.3" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.61.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<PackageReference Include="System.Drawing.Common" Version="4.7.2" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.7.0" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions dotnet/src/dotnetcore/GxPdfReportsCS/GxPdfReportsCS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<EmbeddedResource Include="..\..\dotnetframework\GxPdfReportsCS\sRGB Color Space Profile.icm" Link="sRGB Color Space Profile.icm" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="PdfPig" Version="0.1.8" PrivateAssets="All"/>
<PackageReference Include="PdfPig" Version="0.1.8" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand All @@ -32,8 +32,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<PackageReference Include="System.Drawing.Common" Version="4.7.2" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.7.0" />
<PackageReference Include="GeneXus.Drawing.Common" Version="2.0.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
13 changes: 11 additions & 2 deletions dotnet/src/dotnetcore/GxPdfReportsCS/PDFReportPDFPig.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
using System;
using System.Collections.Generic;
#if NETCORE
using GeneXus.Drawing;
using GeneXus.Drawing.Imaging;
using GeneXus.Drawing.Text;
using GeneXus.Drawing.Drawing2D;
using Color = GeneXus.Drawing.Color;
using Font = GeneXus.Drawing.Font;
#else
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Drawing.Text;
using Color = System.Drawing.Color;
using Font = System.Drawing.Font;
#endif
using System.IO;
using System.Net.Http;
using System.Text;
Expand All @@ -14,8 +25,6 @@
using static GeneXus.Utils.StringUtil;
using static UglyToad.PdfPig.Writer.PdfDocumentBuilder;
using static UglyToad.PdfPig.Writer.PdfPageBuilder;
using Color = System.Drawing.Color;
using Font = System.Drawing.Font;
using PageSize = UglyToad.PdfPig.Content.PageSize;
using PdfRectangle = UglyToad.PdfPig.Core.PdfRectangle;

Expand Down
30 changes: 26 additions & 4 deletions dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,25 @@
using GeneXus.Cryptography;
using GeneXus.Data.NTier;
using System.Collections.Generic;
using System.Drawing;
using Microsoft.Win32;
using System.Security.Cryptography;
using System.Collections.Concurrent;
using System.Drawing.Drawing2D;
using GeneXus.Storage;
using GeneXus.Services;
using GeneXus.Http;
using System.Security;
using System.Drawing.Imaging;
using System.Net.Http.Headers;
#if NETCORE
using Image = GeneXus.Drawing.Image;
using GeneXus.Drawing;
using GeneXus.Drawing.Drawing2D;
using GeneXus.Drawing.Imaging;
#else
using Image = System.Drawing.Image;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
#endif
using System.Net.Http;

namespace GeneXus.Utils
Expand Down Expand Up @@ -6098,7 +6105,11 @@ public static string Resize(string imageFile, int width, int height, bool keepAs
newheight = (int)(image.Height / resize);// set the new heigth of the current image
}//return the image resized to the given heigth and width
Image output = image.GetThumbnailImage(width, newheight, null, IntPtr.Zero);
#if NETCORE
modifiedImage = Save(output, imageFile,ImageFormat.Png);
#else
modifiedImage = Save(output, imageFile, ImageFormat.Bmp);
#endif
}
}
catch (Exception ex)
Expand Down Expand Up @@ -6137,14 +6148,20 @@ public static string Crop(string imageFile, int X, int Y, int Width, int Height)
{
using (Bitmap bmp = new Bitmap(Width, Height))
{
#if !NETCORE
bmp.SetResolution(OriginalImage.HorizontalResolution, OriginalImage.VerticalResolution);
#endif
using (Graphics Graphic = Graphics.FromImage(bmp))
{
Graphic.SmoothingMode = SmoothingMode.AntiAlias;
Graphic.InterpolationMode = InterpolationMode.HighQualityBicubic;
Graphic.PixelOffsetMode = PixelOffsetMode.HighQuality;
Graphic.DrawImage(OriginalImage, new Rectangle(0, 0, Width, Height), X, Y, Width, Height, GraphicsUnit.Pixel);
modifiedImage = Save(bmp, imageFile, OriginalImage.RawFormat);
#if NETCORE
modifiedImage = Save(bmp, imageFile, ImageFormat.Png);
#else
modifiedImage = Save(bmp, imageFile, ImageFormat.Bmp);
#endif
}
}
}
Expand Down Expand Up @@ -6303,7 +6320,11 @@ public static string Save(Image bitmap, string imageFile, ImageFormat format)
{
//In some cases, copied memory image fails to save when ImageFormat MemoryBmp
//https://stackoverflow.com/questions/9073619/image-save-crashing-value-cannot-be-null-r-nparameter-name-encoder
#if NETCORE
bitmap.Save(ms, ImageFormat.Png);
#else
bitmap.Save(ms, ImageFormat.Bmp);
#endif
}
ms.Position = 0;
try
Expand Down Expand Up @@ -6377,6 +6398,7 @@ public static long GetFileSize(string imageFile)
return 0;
}
}

public class StorageUtils
{
public const string DELIMITER = "/";
Expand Down
10 changes: 10 additions & 0 deletions dotnet/src/dotnetframework/GxClasses/Data/GXDataCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,8 @@ public class GxSqlServer : GxDataRecord
private const int MILLISECONDS_BETWEEN_RETRY_ATTEMPTS = 500;
private const string MULTIPLE_DATAREADERS = "MultipleActiveResultSets";
#if NETCORE
private const string TRUST_SERVER_CERTIFICATE = "TrustServerCertificate";
private const bool TRUST_CERT_DEFAULT = true;
private const string INTEGRATED_SECURITY = "Integrated Security";
private const string INTEGRATED_SECURITY_NO = "no";
#endif
Expand Down Expand Up @@ -2062,6 +2064,14 @@ protected override string BuildConnectionString(string datasourceName, string us
connectionString.AppendFormat(";Password={0}", userPassword);
}
extra = ResolveConnectionStringAuthentication(extra, additionalConnectionString);

string tSrvCertificate = GetParameterValue(extra, TRUST_SERVER_CERTIFICATE);
if (string.IsNullOrEmpty(tSrvCertificate))
{
//TODO:Remove Temporary compatibility setting to bypass certificate validation
connectionString.AppendFormat(";{0}={1}", TRUST_SERVER_CERTIFICATE, TRUST_CERT_DEFAULT);
}

#else
if (userId!=null)
{
Expand Down
Loading
Loading