Skip to content

Commit

Permalink
Updated NET6 and 8 project
Browse files Browse the repository at this point in the history
  • Loading branch information
Suriya-Murugan committed Mar 7, 2024
1 parent d82fd1d commit 00e849e
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2009
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EJ2APIServices", "src\EJ2APIServices.csproj", "{D2F1360E-DF8C-4AD2-A8CC-942A180D6762}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EJ2APIServices", "src\EJ2APIServices_NET6.csproj", "{D2F1360E-DF8C-4AD2-A8CC-942A180D6762}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
25 changes: 25 additions & 0 deletions ASP.NET Core/EJ2APIServices_NET8.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2009
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EJ2APIServices", "src\EJ2APIServices_NET8.csproj", "{D2F1360E-DF8C-4AD2-A8CC-942A180D6762}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D2F1360E-DF8C-4AD2-A8CC-942A180D6762}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D2F1360E-DF8C-4AD2-A8CC-942A180D6762}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D2F1360E-DF8C-4AD2-A8CC-942A180D6762}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2F1360E-DF8C-4AD2-A8CC-942A180D6762}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {00388905-5E88-4BCF-B5FC-E4CAB5FA88EE}
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions ASP.NET Core/src/Controllers/DocumentEditorController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ namespace SyncfusionDocument.Controllers
[Route("api/[controller]")]
public class DocumentEditorController : Controller
{
private readonly IHostingEnvironment _hostingEnvironment;
private readonly IWebHostEnvironment _hostingEnvironment;
string path;

public DocumentEditorController(IHostingEnvironment hostingEnvironment)
public DocumentEditorController(IWebHostEnvironment hostingEnvironment)
{
_hostingEnvironment = hostingEnvironment;
path = Startup.path;
Expand Down
45 changes: 45 additions & 0 deletions ASP.NET Core/src/EJ2APIServices_NET6.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Data\**" />
<Content Remove="Data\**" />
<EmbeddedResource Remove="Data\**" />
<None Remove="Data\**" />
</ItemGroup>


<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="BitMiracle.LibTiff.NET" Version="2.4.649" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="*" />
</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.2" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OData" Version="7.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.0" />
<PackageReference Include="Npgsql" Version="4.0.2" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.1.1.1" />
<PackageReference Include="SkiaSharp" Version="2.88.6" />
<PackageReference Include="Syncfusion.Compression.Net.Core" Version="*" />
<PackageReference Include="Syncfusion.OfficeChart.Net.Core" Version="*" />
<PackageReference Include="Syncfusion.EJ2.WordEditor.AspNet.Core" Version="*" />
<PackageReference Include="Syncfusion.EJ2.SpellChecker.AspNet.Core" Version="*" />
<PackageReference Include="System.Drawing.Common" Version="4.*" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.0.9.2" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.*" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>

Expand Down
38 changes: 23 additions & 15 deletions ASP.NET Core/src/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.EntityFrameworkCore;
using Microsoft.Data.Edm;
using Microsoft.AspNet.OData.Builder;
using Microsoft.AspNet.OData.Extensions;
using Microsoft.AspNetCore.Routing;
Expand All @@ -20,6 +19,7 @@
using Syncfusion.EJ2.SpellChecker;
using System.IO;
using Newtonsoft.Json;
using Microsoft.Extensions.Hosting;


namespace EJ2APIServices
Expand All @@ -29,7 +29,7 @@ public class Startup
private string _contentRootPath = "";
internal static string path;

public Startup(IConfiguration configuration, IHostingEnvironment env)
public Startup(IConfiguration configuration, IWebHostEnvironment env)
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
Expand Down Expand Up @@ -65,49 +65,57 @@ public Startup(IConfiguration configuration, IHostingEnvironment env)

public IConfiguration Configuration { get; }

// This method gets called by the runtime. Use this method to add services to the container.
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddOData();
services.AddMvc().AddJsonOptions(x => {
x.SerializerSettings.ContractResolver = null;
services.AddControllers().AddJsonOptions(options =>
{
options.JsonSerializerOptions.PropertyNamingPolicy = null;
});

services.AddCors(options =>
{
options.AddPolicy("AllowAllOrigins", builder =>
{
builder.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader();
.AllowAnyMethod()
.AllowAnyHeader();
});
});

string connection = Configuration.GetConnectionString("Test");
if (connection.Contains("%CONTENTROOTPATH%"))
{
connection = connection.Replace("%CONTENTROOTPATH%", _contentRootPath);

}
services.AddEntityFrameworkNpgsql().AddDbContext<EEJ2SERVICEEJ2WEBSERVICESSRCAPP_DATADIAGRAMMDFContext>(options => options.UseNpgsql(connection));

services.AddDbContext<EEJ2SERVICEEJ2WEBSERVICESSRCAPP_DATADIAGRAMMDFContext>(options =>
options.UseNpgsql(connection));

// Add framework services.
services.AddMvc();
services.AddControllers();
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseDeveloperExceptionPage();
app.UseCors("AllowAllOrigins");
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}

app.UseMvc(b =>
app.UseCors("AllowAllOrigins");

app.UseRouting();

app.UseAuthorization();

app.UseEndpoints(endpoints =>
{
b.Count().Filter().OrderBy().Expand().Select().MaxTop(null);
endpoints.MapControllers();
});

}

}
Expand Down
4 changes: 2 additions & 2 deletions ASP.NET Core/src/web.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
</requestFiltering>
</security>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" arguments="%LAUNCHER_ARGS%">
<aspNetCore processPath="%LAUNCHER_PATH%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" arguments="%LAUNCHER_ARGS%" hostingModel="InProcess">
<environmentVariables />
</aspNetCore>
</system.webServer>
Expand Down

0 comments on commit 00e849e

Please sign in to comment.