Skip to content

Commit b3ce98a

Browse files
committed
update to .net10
1 parent c674992 commit b3ce98a

11 files changed

Lines changed: 40 additions & 79 deletions

File tree

OSS.Data/OSS.Data.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<PropertyGroup>
11-
<TargetFramework>net8.0</TargetFramework>
11+
<TargetFramework>net10.0</TargetFramework>
1212
</PropertyGroup>
1313

1414
<ItemGroup>
@@ -18,7 +18,7 @@
1818
</ItemGroup>
1919

2020
<ItemGroup>
21-
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.3" />
21+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="10.0.3" />
2222
</ItemGroup>
2323

2424

OSS.Services/ExportImport/Help/PropertyManager.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public virtual async Task WriteToXlsxAsync(IXLWorksheet worksheet, int row, int
138138
if (!UseDropdownLists)
139139
continue;
140140

141-
var validator = cell.DataValidation;
141+
var validator = cell.CreateDataValidation();
142142
validator.InCellDropdown = true;
143143

144144
validator.IgnoreBlanks = prop.AllowBlank;
@@ -151,7 +151,7 @@ public virtual async Task WriteToXlsxAsync(IXLWorksheet worksheet, int row, int
151151
{
152152
var fCell = fWorksheet.Row(fRow++).Cell(prop.PropertyOrderPosition);
153153

154-
if (fCell.Value != null && fCell.Value.ToString() == dropDownElement)
154+
if (fCell.Value.ToString() == dropDownElement)
155155
break;
156156

157157
fCell.Value = dropDownElement;
@@ -172,15 +172,15 @@ public virtual async Task WriteToXlsxAsync(IXLWorksheet worksheet, int row, int
172172
}
173173
else if (value is Guid guidValue)
174174
{
175-
cell.SetValue(guidValue);
175+
cell.SetValue(guidValue.ToString());
176176
}
177177
else if (value is Enum enumValue)
178178
{
179-
cell.SetValue(enumValue);
179+
cell.SetValue((XLCellValue)enumValue);
180180
}
181181
else
182182
{
183-
cell.Value = value;
183+
cell.Value = value.ToString();
184184
}
185185
}
186186
cell.Style.Alignment.WrapText = false;
@@ -215,7 +215,7 @@ public virtual void WriteCaption(IXLWorksheet worksheet, int row = 1, int cellOf
215215
foreach (var caption in _properties.Values)
216216
{
217217
var cell = worksheet.Row(row).Cell(caption.PropertyOrderPosition + cellOffset);
218-
cell.Value = caption;
218+
cell.Value = caption.ToString();
219219

220220
SetCaptionStyle(cell);
221221
}

OSS.Services/OSS.Services.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
</PropertyGroup>
99

1010
<PropertyGroup>
11-
<TargetFramework>net8.0</TargetFramework>
11+
<TargetFramework>net10.0</TargetFramework>
1212
</PropertyGroup>
1313

1414
<ItemGroup>
1515
<PackageReference Include="AutoMapper" Version="13.0.1" />
16-
<PackageReference Include="ClosedXML" Version="0.95.4" />
17-
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.2.0" />
18-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.3" />
19-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.3">
16+
<PackageReference Include="ClosedXML" Version="0.105.0" />
17+
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.3.9" />
18+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.3" />
19+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.3">
2020
<PrivateAssets>all</PrivateAssets>
2121
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2222
</PackageReference>

OSS.Tests/OSS.Tests.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
11-
<PackageReference Include="Moq" Version="4.20.70" />
12-
<PackageReference Include="NUnit" Version="4.1.0" />
13-
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
14-
<PackageReference Include="coverlet.collector" Version="6.0.2">
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
11+
<PackageReference Include="Moq" Version="4.20.72" />
12+
<PackageReference Include="NUnit" Version="4.5.0" />
13+
<PackageReference Include="NUnit3TestAdapter" Version="6.1.0" />
14+
<PackageReference Include="coverlet.collector" Version="8.0.0">
1515
<PrivateAssets>all</PrivateAssets>
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1717
</PackageReference>

OSS.Web.sln

Lines changed: 0 additions & 48 deletions
This file was deleted.

OSS.Web/App_Data/OSS_DB.mdf

0 Bytes
Binary file not shown.

OSS.Web/App_Data/OSS_DB_log.ldf

0 Bytes
Binary file not shown.

OSS.Web/Components/SidebarMenu.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ public async Task<IViewComponentResult> InvokeAsync(int? productThumbPictureSize
1717
var allowedPages = "";
1818
if (this.UserClaimsPrincipal != null && this.UserClaimsPrincipal.Claims != null && this.UserClaimsPrincipal.Claims.Count() > 0)
1919
{
20-
allowedPages = this.UserClaimsPrincipal.Claims.Where(c => c.Type == "AllowedPages").FirstOrDefault().Value;
20+
var pagesclaim = this.UserClaimsPrincipal.Claims.FirstOrDefault(c => c.Type == "AllowedPages");
21+
if (pagesclaim != null) allowedPages = pagesclaim.Value;
2122
}
2223

2324
var model = await _cModelFactory.PrepareSideMenu(allowedPages);

OSS.Web/OSS.Web.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<PropertyGroup>
11-
<TargetFramework>net8.0</TargetFramework>
11+
<TargetFramework>net10.0</TargetFramework>
1212
<UserSecretsId>aspnet-OSS.Web-B82FDBC3-D70E-45C9-A7F8-44AD553B749C</UserSecretsId>
1313
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
1414
</PropertyGroup>
@@ -21,12 +21,13 @@
2121
<ItemGroup>
2222
<PackageReference Include="FluentValidation" Version="11.9.0" />
2323
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" />
24-
<PackageReference Include="MailKit" Version="4.4.0" />
25-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.3" />
26-
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.1.0" />
27-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.3" />
28-
<PackageReference Include="MimeKit" Version="4.4.0" />
29-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.3">
24+
<PackageReference Include="MailKit" Version="4.15.0" />
25+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="10.0.3" />
26+
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
27+
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.2.9" />
28+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.3" />
29+
<PackageReference Include="MimeKit" Version="4.15.0" />
30+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.3">
3031
<PrivateAssets>all</PrivateAssets>
3132
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3233
</PackageReference>
@@ -82,8 +83,7 @@
8283
</ItemGroup>
8384

8485
<ItemGroup>
85-
<Content Include="views\**">
86-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
87-
</Content>
86+
<!-- The SDK implicitly includes content files from the project folder. Removing the explicit Content include
87+
for the views folder to avoid duplicate 'Content' items when targeting .NET 10. -->
8888
</ItemGroup>
8989
</Project>

OSS.Web/Startup.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ public void ConfigureServices(IServiceCollection services)
4545
// //options.MinimumSameSitePolicy = SameSiteMode.Unspecified;
4646

4747
//});
48-
var scon = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Working\CODE\OSS\OSS.Web\OSS.Web\App_Data\OSS_DB.mdf;Integrated Security=True";
48+
49+
// var scon = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Working\CODE\OSS\OSS.Web\OSS.Web\App_Data\OSS_DB.mdf;Integrated Security=True";
50+
var scon = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=D:\ESSAM\CODE\OSS\OSS.Web\App_Data\OSS_DB.mdf;Integrated Security=True";
4951
var constr = Configuration.GetConnectionString("DefaultConnection");
5052
services.AddControllersWithViews();
5153
services.AddRazorPages();

0 commit comments

Comments
 (0)