Starting with 3.12 Serenity supports ASP.NET Core 3.1, and this is an upgrade guide for those who use .NET Core version and wish to upgrade to .NET Core 3.1.
Please note that this document and warnings below has nothing to do with those who use .NET MVC version of Serenity (although you are strongly recommended to migrate to .NET Core version, as ASP.NET MVC has no future).
Important Warnings:
<ItemGroup>
<DotNetCliToolReference Include="Serenity.CodeGenerator" Version="3.9.14" />
</ItemGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
with:
<TargetFramework>netcoreapp3.1</TargetFramework>
<DotNetSergen Condition=" '$(TargetFramework)' == 'net461' AND Exists('..\..\Serenity\Serenity.CodeGenerator\bin\$(Configuration)\$(TargetFramework)\dotnet-sergen.exe')">..\..\Serenity\Serenity.CodeGenerator\bin\$(Configuration)\$(TargetFramework)\dotnet-sergen.exe</DotNetSergen>
<DotNetSergen Condition=" '$(TargetFramework)' == 'netcoreapp2.2' AND Exists('..\..\Serenity\Serenity.CodeGenerator\bin\$(Configuration)\$(TargetFramework)\dotnet-sergen.dll')">dotnet ..\..\Serenity\Serenity.CodeGenerator\bin\$(Configuration)\$(TargetFramework)\dotnet-sergen.dll</DotNetSergen>
with:
<DotNetSergen Condition="Exists('..\..\Serenity\Serenity.CodeGenerator\bin\$(Configuration)\sergen.exe')">..\..\Serenity\Serenity.CodeGenerator\bin\$(Configuration)\sergen.exe</DotNetSergen>
<TypeScriptToolsVersion>3.0</TypeScriptToolsVersion>
with:
<TypeScriptToolsVersion>3.7</TypeScriptToolsVersion>
And replace this line:
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="3.1.1" />
with:
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="3.7.4" />
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<PackageReference Include="EPPlus" Version="4.5.2.1" />
...
... remove this ItemGroup and just this one with '$(TargetFramework)' == 'net461'
...
<PackageReference Include="Serenity.Scripts" Version="3.9.14" />
</ItemGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net461' ">
<PlatformTarget>x64</PlatformTarget>
<DefineConstants>$(DefineConstants);ASPNETCORE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MailKit" Version="2.0.6" />
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="3.7.4" />
<PackageReference Include="Serenity.FluentMigrator.Runner" Version="1.6.904" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.2' ">
<PackageReference Include="EPPlus" Version="4.5.2.1" />
<PackageReference Include="FastMember" Version="1.4.1" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Serenity.Web" Version="3.9.14" />
<PackageReference Include="Serenity.Web.Assets" Version="3.9.2" />
<PackageReference Include="Serenity.Scripts" Version="3.9.14" />
</ItemGroup>
and remove the first ItemGroup closing tag, and ItemGroup opening tag with Condition so that it looks like this (we are just merging item groups and removing the unused condition):
<ItemGroup>
<PackageReference Include="MailKit" Version="2.0.6" />
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="3.7.4" />
<PackageReference Include="Serenity.FluentMigrator.Runner" Version="1.6.904" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.0.0" />
<PackageReference Include="EPPlus" Version="4.5.2.1" />
<PackageReference Include="FastMember" Version="1.4.1" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Serenity.Web" Version="3.9.14" />
<PackageReference Include="Serenity.Web.Assets" Version="3.9.2" />
<PackageReference Include="Serenity.Scripts" Version="3.9.14" />
</ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.0" />
<PackageReference Include="Serenity.Pro.Scripts" Version="3.9.10" />
<PackageReference Include="Serenity.Scripts" Version="3.9.14" />
<PackageReference Include="Serenity.Web" Version="3.9.14" Condition="!Exists('..\..\Serenity\Serenity.Core\Serenity.Core.csproj')" />
<PackageReference Include="Serenity.Web.Assets" Version="3.9.2" />
The line with Serenity.Pro.Scripts is only for StartSharp users.
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="3.7.4"/>
<ItemGroup>
<PackageReference Include="EPPlus" Version="4.5.3.2" />
<PackageReference Include="FastMember" Version="1.5.0" />
<PackageReference Include="MailKit" Version="2.4.1" />
<PackageReference Include="Mapster" Version="4.1.1" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="3.1.0" />
<PackageReference Include="StackExchange.Exceptional.AspNetCore" Version="2.1.0" />
</ItemGroup>
The lines with StackExchange.Exceptional and Mapster are only for StartSharp users.
Eventually your ItemGroup should look similar to this (for Serene):
<ItemGroup>
<PackageReference Include="EPPlus" Version="4.5.3.2" />
<PackageReference Include="FastMember" Version="1.5.0" />
<PackageReference Include="MailKit" Version="2.4.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="3.1.0" />
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="3.7.4"/>
<PackageReference Include="Serenity.FluentMigrator.Runner" Version="1.6.904" />
<PackageReference Include="Serenity.Scripts" Version="3.9.14" />
<PackageReference Include="Serenity.Web" Version="3.9.14" Condition="!Exists('..\..\Serenity\Serenity.Core\Serenity.Core.csproj')" />
<PackageReference Include="Serenity.Web.Assets" Version="3.9.2" />
</ItemGroup>
You might also have extra packages there if you did install some yourself, so don't remove them, the above one is just a sample.
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.2' ">
<DefineConstants>$(DefineConstants);COREFX;ASPNETCORE</DefineConstants>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
so that it looks like this:
<PropertyGroup>
<DefineConstants>$(DefineConstants);COREFX;ASPNETCORE</DefineConstants>
</PropertyGroup>
<Target Name="TransformMvcClientTypes" BeforeTargets="BeforeBuild">
<Exec Command="$(DotNetSergen) mvct" ContinueOnError="true" />
</Target>
with this (insert dotnet tool restore line):
<Target Name="TransformMvcClientTypes" BeforeTargets="BeforeBuild">
<Exec Command="dotnet tool restore" ContinueOnError="true" />
<Exec Command="$(DotNetSergen) mvct" ContinueOnError="true" />
</Target>
dotnet new tool-manifest
dotnet tool install sergen
dotnet restore
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
namespace ..MyProject..
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args)
{
return Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.ConfigureAppConfiguration((builderContext, config) =>
{
config.AddJsonFile($"appsettings.machine.json", optional: true);
});
}
}
}
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.Extensions.Hosting;
public Startup(IConfiguration configuration, IWebHostEnvironment hostEnvironment)
{
Configuration = configuration;
}
to this:
public Startup(IConfiguration configuration, IWebHostEnvironment hostEnvironment)
{
Configuration = configuration;
HostEnvironment = hostEnvironment;
}
public IConfiguration Configuration { get; }
public IWebHostEnvironment HostEnvironment { get; }
services.Configure<KestrelServerOptions>(options =>
{
options.AllowSynchronousIO = true;
});
services.Configure<IISServerOptions>(options =>
{
options.AllowSynchronousIO = true;
});
services.AddMvc(options =>
{
options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute());
options.Filters.Add(typeof(AntiforgeryCookieResultFilterAttribute));
options.ModelBinderProviders.Insert(0, new ServiceEndpointModelBinderProvider());
options.Conventions.Add(new ServiceEndpointActionModelConvention());
})
.AddJsonOptions(options =>
{
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
});
with:
var builder = services.AddControllersWithViews(options =>
{
options.Filters.Add(typeof(AutoValidateAntiforgeryTokenAttribute));
options.Filters.Add(typeof(AntiforgeryCookieResultFilterAttribute));
options.ModelBinderProviders.Insert(0, new ServiceEndpointModelBinderProvider());
options.Conventions.Add(new ServiceEndpointActionModelConvention());
}).AddNewtonsoftJson(options =>
{
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
});
if (HostEnvironment.IsDevelopment())
builder.AddRazorRuntimeCompilation();
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory, IAntiforgery antiforgery)
app.UseStaticFiles();
app.UseRouting(); // insert this
app.UseAuthentication();
app.UseAuthorization(); // insert this
app.UseMvc(routes =>
{
});
with:
app.UseEndpoints(endpoints => {
endpoints.MapControllers();
});
Edit Initialization/DataMigrations.cs, SergenEdpoint.cs, and EmailHelper.cs. Replace IHostingEnvironment with IWebHostEnvironment (there should be five or so).
Rebuild the solution and make sure there are no errors.
It was a long upgrade guide but unfortunately there are too many changes in ASP.NET Core and .NET Core themselves. You may look at following guides to see how complex it is (particulary the first one):
Great job @volkanceylan !!
(Now we know what you did over Chrismas... :-))
Good to see you back in full action :-)
Wish you a great, successful 2020.
With kind regards,
John
Great news,
another good news is my renewal subscription for another year with this awesome Framework
great!has adminLTE also upgraded to 3?
Great job! Thank you very much @volkanceylan !
Thank you @volkanceylan for your hard work and progress on Serenity - my favourite framework!
I followed this guide on my project and I'm getting a warning and error about Razor. Maybe this is just something that I've done?
1>------ Build started: Project: MyApp.Web, Configuration: Debug Any CPU ------
1>Tool 'sergen' (version '3.12.0') was restored. Available commands: sergen
1>
1>Restore was successful.
1>Transforming MVC at: C:\source\repos\MyApp\MyApp\MyApp.Web\Imports\MVC
1>Transforming ClientTypes at: C:\source\repos\MyApp\MyApp\MyApp.Web\Imports\ClientTypes
1>C:\Program Files\dotnet\sdk\3.1.100\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets(404,5): warning RAZORSDK1006: Detected Razor language version downgrade. This is typically caused by a reference to the Microsoft.AspNetCore.Razor.Design package. Consider removing this package reference.
1>C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.razor.design\2.1.1\build\netstandard2.0\Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets(69,5): error : The project C:\source\repos\MyApp\MyApp\MyApp.Web must provide a value for Configuration.
1>Done building project "MyApp.Web.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
It mentions removing the Microsoft.AspNetCore.Razor.Design package, but I can't seem to find this package or reference to it.
My environment before upgrade:
Has anyone else migrated and/or run into this issue?
Thank you,
Edward
Hi @volkanceylan
Thank you for update.
Kindly request you to please prepare and share Migration tutorial of Serenity MVC to .NET core version.
Thanks.
@edwardch need your CSPROJ file references section
Here we go
<ItemGroup>
<PackageReference Include="Azure.Storage.Blobs" Version="12.1.0" />
<PackageReference Include="CsvHelper" Version="12.2.3" />
<PackageReference Include="DocumentFormat.OpenXml" Version="2.9.1" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.7.8" />
<PackageReference Include="HangFire.Core" Version="1.7.8" />
<PackageReference Include="HangFire.SqlServer" Version="1.7.8" />
<PackageReference Include="MailKit" Version="2.4.1" />
<PackageReference Include="Mapster" Version="4.1.1" />
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="3.7.4" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.9.10" />
<PackageReference Include="Serenity.FluentMigrator.Runner" Version="1.6.904" />
<PackageReference Include="Serenity.Pro.Scripts" Version="3.9.10" />
<PackageReference Include="Spire.XLS" Version="9.12.20" />
<PackageReference Include="StackExchange.Exceptional.AspNetCore" Version="2.1.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="3.1.0" />
<PackageReference Include="Telerik.Reporting" Version="13.0.19.222" />
<PackageReference Include="Telerik.Reporting.OpenXmlRendering" Version="13.0.19.222" />
<PackageReference Include="Telerik.Reporting.Services.AspNetCore" Version="13.0.19.222" />
<PackageReference Include="EPPlus" Version="4.5.3.2" />
<PackageReference Include="FastMember" Version="1.5.0" />
<PackageReference Include="Serenity.Web" Version="3.12.0" Condition="!Exists('..\..\Serenity\Serenity.Core\Serenity.Core.csproj')" />
<PackageReference Include="Serenity.Web.Assets" Version="3.9.2" />
<PackageReference Include="Serenity.Scripts" Version="3.12.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.0" />
</ItemGroup>
Here we go
<ItemGroup> <PackageReference Include="Azure.Storage.Blobs" Version="12.1.0" /> <PackageReference Include="CsvHelper" Version="12.2.3" /> <PackageReference Include="DocumentFormat.OpenXml" Version="2.9.1" /> <PackageReference Include="Hangfire.AspNetCore" Version="1.7.8" /> <PackageReference Include="HangFire.Core" Version="1.7.8" /> <PackageReference Include="HangFire.SqlServer" Version="1.7.8" /> <PackageReference Include="MailKit" Version="2.4.1" /> <PackageReference Include="Mapster" Version="4.1.1" /> <PackageReference Include="Microsoft.TypeScript.MSBuild" Version="3.7.4" /> <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.9.10" /> <PackageReference Include="Serenity.FluentMigrator.Runner" Version="1.6.904" /> <PackageReference Include="Serenity.Pro.Scripts" Version="3.9.10" /> <PackageReference Include="Spire.XLS" Version="9.12.20" /> <PackageReference Include="StackExchange.Exceptional.AspNetCore" Version="2.1.0" /> <PackageReference Include="Microsoft.Data.Sqlite" Version="3.1.0" /> <PackageReference Include="Telerik.Reporting" Version="13.0.19.222" /> <PackageReference Include="Telerik.Reporting.OpenXmlRendering" Version="13.0.19.222" /> <PackageReference Include="Telerik.Reporting.Services.AspNetCore" Version="13.0.19.222" /> <PackageReference Include="EPPlus" Version="4.5.3.2" /> <PackageReference Include="FastMember" Version="1.5.0" /> <PackageReference Include="Serenity.Web" Version="3.12.0" Condition="!Exists('..\..\Serenity\Serenity.Core\Serenity.Core.csproj')" /> <PackageReference Include="Serenity.Web.Assets" Version="3.9.2" /> <PackageReference Include="Serenity.Scripts" Version="3.12.0" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.0" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.0" /> </ItemGroup>
Hi @edwardch ,
found that you are using telerik reporting.. Can you please help me on implementation of telerik reporting on serenity project.
skype Id: [email protected]
Regards,
Mustufa
@mustafalotiya I have this working in .NET MVC, and working 95% in .NET Core.
The catch in .NET Core is that the reports are not finding my named connection string. Reports that do not use a connection string do work though. I got paid-for support from Volkan to help me set this up initially for the .NET MVC version, and I plan on fixing that connection string issue first before creating a tutorial on how to do that.
I will post an issue to announce when the tutorial is complete.
@mustafalotiya I have this working in .NET MVC, and working 95% in .NET Core.
The catch in .NET Core is that the reports are not finding my named connection string. Reports that do not use a connection string do work though. I got paid-for support from Volkan to help me set this up initially for the .NET MVC version, and I plan on fixing that connection string issue first before creating a tutorial on how to do that.
I will post an issue to announce when the tutorial is complete.
As of now my all developments in Serenity MVC framework and looking for good reporting tool. it would be great help.
@edwardch I had a similar problem but it only showed up after I tried to publish the app, so in my case it was related to my publish setup.
@RouteTech I haven't got any publish profiles, but I'm interested to know what you had different in your publish profile to what was on your local/dev environment?
@edwardch Telerik.Reporting.Services.AspNetCore 13.0.19.222 probably has reference to ASP.NET Core 2.0, as the package is private i can't check deps
Telerik.Reporting for example is listed in NuGet only for 13.2.19.1030 and it is dependent on .NETCoreApp2.0 so i guess your version is also. You need a .NETCoreApp3.1 version
@edwardch I had it in two situations, the first was one of the parameters in the existing profile was targetting the 2.2 framework and I didn't notice. The second was when I was trying to "Make a tiny .NET Core 3.0 entirely self-contained single executable"
@edwardch Telerik.Reporting.Services.AspNetCore 13.0.19.222 probably has reference to ASP.NET Core 2.0, as the package is private i can't check deps
Thank you @volkanceylan, that was exactly the issue! Project now builds successfully.
It won't run yet though because when adding the Hangfire service in Startup.cs it uses SqlConnections.GetConnectionString("Default").ConnectionString, and I get an error System.InvalidOperationException: 'No connection string with key Default in configuration file!'
I will have another look tomorrow as I need to go out now.
After the upgrade I could not get the connection string for Hangfire to work in my Startup.cs (mentioned above).
SqlConnections.GetConnectionString("Hangfire")
This returns System.InvalidOperationException: 'No connection string with key Hangfire in configuration file!'
To get around the error I changed it to this:
Configuration.GetValue<string>("Data:Hangfire:ConnectionString")
@volkanceylan This worked, and I may be wrong, but this seems like a non-standard way of defining the connection string, I'd be interested to know why it is done this way?
My other option was to define a ConnectionStrings section in my appsettings.json file like I've previously seen online:
"Data": {
"Default": {
"ConnectionString": "Server=(localdb)\\MsSqlLocalDB;Database=Serene_Default_v1;Integrated Security=true",
"ProviderName": "System.Data.SqlClient"
}
},
"ConnectionStrings": {
"Hangfire": "Server=(localdb)\\MsSqlLocalDB;Database=Serene_Default_v1;Integrated Security=true",
"ProviderName": "System.Data.SqlClient"
},
"Logging": "..."
Then refer to this connection string in Startup.cs like so:
Configuration.GetConnectionString("Hangfire")
I have it working, though I see SqlConnections.GetConnectionString(databaseKey) in DataMigration.cs which works, so any feedback would be useful.
Thank you in advance.
There was standard no connection string section in appsettings for .NET Core when we migrated, there wasn't even a provider system, so no provider name, so we designed our own connection string system.
There wasn't a change to this, i don't know why you are getting error. Anyway you may use Configuration.GetValue that's fine.
Ah that makes sense, thank you for that feedback. I'm happy with the solution and looking forward to getting my upgrades into production!
Thanks for the upgrade guide. Worked great, except the build task "CompileTSC" keeps giving the following error message when building:
1>The directory name is invalid.
1>C:\Users\xxx\Documents\Dev\xxx\src\xxx.Web\xxx.Web.csproj(88,5): warning MSB3073: The command ""C:\Users\xxx\.nuget\packages\microsoft.typescript.msbuild\3.7.4\build\..\tools\tsc\tsc.js\tsc" -p ./tsconfig.json" exited with code 267.
The build task in project file looks like this:
<Target Name="CompileTSC" AfterTargets="AfterBuild" Inputs="@(CompileTSCInputs)" Outputs="wwwroot\Scripts\site\xxx.Web.js">
<Message Text="Executing TypeScript compiler..." Importance="high"></Message>
<Exec Command=""$(TscToolPath.Replace('build\\..\tools\', 'tools\'))\tsc" -p ./tsconfig.json" ContinueOnError="true" />
</Target>
on investigation looks like "tsc.exe" is not part of 3.7.4 Typescript SDK anymore.
Any suggestions for fixing?
@she-ll-b-rite you should first follow other upgrade guides:
hi, i'm trying serenity for the first time.
downloaded it and installed it, upgraded it to 3.1, everything builds with no errors, but when i start the application the site opens but it doesn't show the login screen

it's probably a newbie mistake... but any help would be great
@she-ll-b-rite you should first follow other upgrade guides:
My bad. Thanks 👍
@she-ll-b-rite you should first follow other upgrade guides:
https://serenity.is/docs/startsharp/updating-startsharpHi @volkanceylan ,
I have the same issue with @she-ll-b-rite . I get this error
_An error occurred while starting the application. JsonReaderException: The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. LineNumber: 0 | BytePositionInLine: 0._
inside Program.cs > CreateHostBuilder(args).Build().Run();
and I am not using StartSharp. Any ideas?
Thanks in advance,
Theo
To anyone that has the same problem, I resolved this by adding an empty object {} inside secrets.json
Does anyone know if dotnet sergen servertypings should be still inside building process? I guess I am missing it somehow.
Thanks!
Does anyone know if dotnet sergen servertypings should be still inside building process? I guess I am missing it somehow.
Thanks!
Nvm, I replaced the wrong build tag inside web.csproj.
@vitorsilva Hi
were you able to fix it?
I am getting the same error. seems like no JS scripts are being loaded from IIS Express
so how do I run Sergen now ?
hi, i'm trying serenity for the first time.
downloaded it and installed it, upgraded it to 3.1, everything builds with no errors, but when i start the application the site opens but it doesn't show the login screen
it's probably a newbie mistake... but any help would be great
I have the same problem as @vitorsilva. VS2019 - Serene - ASP.NET Core 2.2 -> 3.1.
@zhiwenchong for me, this was caused by the fact, that no all the files were installed.
Check browser console (F12) for errors. bunch of JS errorrs. Even Bootstrap is missing
Try to generate solution again (that helped me)
Nice job!
Hi,
I just updated from 2.2 to 3.1.
Everything went 99% fluid, very nice!
Sadly I hade a problem with the IF COREFX and IF !COREFX Parts.
I had to exectly reversed as they where before to be able to startup and run my application without error.
I don't know why and what this is doing, but now (for now) its workling.
Any ideas?
Thank you sooo much for taking the time to write this up, it was effortless to move across!