Skip to content

Cannot find reference assembly 'Microsoft.AspNetCore.Antiforgery.dll' while using a FileProviders in net core 3 #14418

@fpanaccia

Description

@fpanaccia

Hi, i have a library that render views and with the html makes a pdf.

When using the Physical Views (the ones that you have in the project) everything works fine.
But when using the fileprovider i get the following error, this was working fine in 2.1

image

I have tried some debuggin of the .net libraries and the farthest i can go without breaking was here.

The code is in this repo https://github.com/fpanaccia/Wkhtmltopdf.NetCore.Example.git and the branch is feature/3.0

namespace Microsoft.AspNetCore.Mvc.Razor.Compilation
internal class DefaultRazorPageFactoryProvider : IRazorPageFactoryProvider
public RazorPageFactoryResult CreateFactory(string relativePath)
line 44 var viewDescriptor = compileTask.GetAwaiter().GetResult();

To Reproduce

Steps to reproduce the behavior:

  1. Download the Repo and the branch
  2. Open the Rotativa.sln
  3. Run it and go to http://localhost:54460/TestDynamicViews/GetByteArray
  4. See error

Expected behavior

Render the View and make the pdf (this is the result with the view in the project) it should have the same result
image

Metadata

Metadata

Assignees

Labels

area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templates

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions