lkosson / reportviewercore

Recompilation of Microsoft.ReportViewer for .NET Core 3.1+
427 stars 123 forks source link

Since StrongName does not have any member properties, is it not usable in related APIs? #133

Closed hyke123 closed 1 year ago

hyke123 commented 1 year ago

LocalReport.AddFullTrustModuleInSandboxAppDomain(StrongName name) How can i set assemblyInfo to StrongName argument?Thanks

lkosson commented 1 year ago

There is no strong name support in .NET Core / .NET 5+. StrongName class is provided for some minimal backward compatibility, but there is no point in using it.

rubimadi commented 1 year ago

How should I rewrite the following code to work with the ported NuGet package?

byte[] publicKey = new byte[8] { 0x51, 0xaa, 0x82, 0xef, 0x09, 0x17, 0x96, 0x80 }; StrongName sn = new StrongName(new StrongNamePublicKeyBlob(publicKey), "Bridge.PDC.Report.Function", new Version("2.0.0.0")); report.AddFullTrustModuleInSandboxAppDomain(sn);

lkosson commented 1 year ago

You shouldn't need to call AddFullTrustModuleInSandboxAppDomain in your code for your report to work, but keep in mind all the report code runs with full trust and there is no way to change that, since .NET Core has no support for CAS. If your report comes from untrusted source, implement some other sandboxing techniques.

rubimadi commented 1 year ago

If I don't call AddFullTrustModuleInSandboxAppDomain in .NET Core, the report isn't created. It seems that the report's definition contains custom code from the assembly Bridge.PDC.Report.Function.dll Not calling AddFullTrustModuleInSandboxAppDomain in .NET Framework works on the other side.

lkosson commented 1 year ago

Please provide either a stack trace of all thrown exceptions or a way to reproduce the problem using one of the sample projects in this repo.