Export html to pdf in ASP.NET Core

You can use jsreport .net sdk if you are in .net core 2.0 also without more complex node services. This includes among other features filters to convert your existing razor views into pdf. From the docs: 1. Install nugets jsreport.Binary, jsreport.Local and jsreport.AspNetCore 2. In you Startup.cs configure it as the following public void ConfigureServices(IServiceCollection … Read more

Upgrading to .NET Core 2.0: PackageTargetFallback and AssetTargetFallback cannot be used together

In .NET Core 1.0 and 1.1, it was needed to set PackageTargetFallback when referencing packages that are known to work on .NET Core but don’t officially support it – e.g. PCL libraries or libraries built for the legacy dotnet framework moniker. Due to this, the project (.csproj, .fsproj, …) will contain a line similar to: … Read more

.NET Core Identity vs IdentityServer4

You really can’t compare the two. ASP.NET Identity is a database API to manage users, roles, claims, email confirmation tokens etc. Something you can use for implementing signup, login, change password etc. IdentityServer is an OpenID Connect and OAuth 2.0 implementation. It gives you features like single sign-on and API access control. This is useful … Read more

IIS fails to run ASP.NET Core site – HTTP Error 502.5

Your problem is a bad web.config file: <aspNetCore requestTimeout=”02:00:00″ processPath=”%LAUNCHER_PATH%” arguments=”%LAUNCHER_ARGS%” stdoutLogEnabled=”true” stdoutLogFile=”.\logs\stdout” forwardWindowsAuthToken=”false” /> The path %LAUNCHER_PATH% does not exist on your system, it is not even valid. It should be something like: <aspNetCore requestTimeout=”02:00:00″ processPath=”.\yourAppName.exe” arguments=”somePossibleArgument” stdoutLogEnabled=”true” stdoutLogFile=”.\logs\stdout” forwardWindowsAuthToken=”false” /> Notice that the web.config file is completely ignored if the app is launched … Read more

Multipart body length limit exceeded exception

I found the solution for this problem after reading some posts in GitHub. Conclusion is that they have to be set in the Startup class. For example: public void ConfigureServices(IServiceCollection services) { services.AddMvc(); services.Configure<FormOptions>(x => { x.ValueLengthLimit = int.MaxValue; x.MultipartBodyLengthLimit = int.MaxValue; // In case of multipart }) } This will solve the problem. However … Read more

How to watch for file changes “dotnet watch” with Visual Studio ASP.NET Core

If you want to use ASP.NET 2.x or 3.x you need to change it a bit. The watch tool is a global tool now and you don’t need to add it as a reference any longer The syntax is slightly different “Watch”: { “executablePath”: “dotnet.exe”, “workingDirectory”: “$(ProjectDir)”, “commandLineArgs”: “watch run”, “launchBrowser”: true, “launchUrl”: “http://localhost:5000/”, “environmentVariables”: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)