Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing obfuscates the wrong files #24

Open
FiddlerKing opened this issue Jun 14, 2022 · 4 comments
Open

Publishing obfuscates the wrong files #24

FiddlerKing opened this issue Jun 14, 2022 · 4 comments

Comments

@FiddlerKing
Copy link

We are experiencing the same phenomenon as described in this issue: Build errors after referencing this package

Referencing this package and making the first publish all builds fails after that.

It doesn't matter if we publish from VS 2022 or from the command line.

What happens is that when we publish the project this package obfuscates the wrong files, it obfuscates the files in the nuget-cache folder and not the actual published files.

BlazorWasmAntivirusProtection: Xor'ed dll C:\Users\xxxxx\.nuget\packages\microsoft.netcore.app.runtime.mono.browser-wasm\6.0.5\runtimes\browser-wasm\lib\net6.0\System.Security.dll
BlazorWasmAntivirusProtection: Xor'ed dll C:\Users\xxxxx\.nuget\packages\microsoft.netcore.app.runtime.mono.browser-wasm\6.0.5\runtimes\browser-wasm\lib\net6.0\System.Security.Principal.dll
BlazorWasmAntivirusProtection: Xor'ed dll C:\Users\xxxxx\.nuget\packages\microsoft.netcore.app.runtime.mono.browser-wasm\6.0.5\runtimes\browser-wasm\lib\net6.0\System.Security.Principal.Windows.dll
BlazorWasmAntivirusProtection: Xor'ed dll C:\Users\xxxxx\.nuget\packages\microsoft.netcore.app.runtime.mono.browser-wasm\6.0.5\runtimes\browser-wasm\lib\net6.0\System.Security.SecureString.dll

To be able to make a new build, we have to remove all files from the nuget-cache folder.

Using VS 2022, Net 6.03 and version 1.8 of this package. Doing a Release publish to local folder.

Any suggestions?

@stavroskasidis
Copy link
Owner

I have no idea how that would happen.

The code is getting a list of

public ITaskItem[] PublishBlazorBootStaticWebAsset { get; set; }

passed on by the blazor ms build tasks, and running the obfuscation against them.

It seems that for some reason it is using the cache folder dll instead of the copies inside the obj folder.
A project that reproduces this behavior would help me solve this, since I cannot reproduce locally.

@FiddlerKing
Copy link
Author

FiddlerKing commented Jun 14, 2022

Here is a copy of your own SampleApp, slightly modified to use Net 6.0.3 and the release version of 1.8

In VS 2022 create a publishing profile that publishes to a folder using the suggested folder. Then hit publish. Version of VS used was 17.1.2

BlazorHostedSampleApp.zip

It seems that the <PublishTrimmed> tag in the project is the culprit.

Let me know if there is anything more needed.

@stavroskasidis
Copy link
Owner

Thank you. That helps me a lot. I will track down the issue and try to come up with a solution

@stavroskasidis
Copy link
Owner

I have identified the issue but I am not sure how to solve it. It seems that to fix this either a tremendous amount of work is required or having more knowledge about the Blazor msbuild pipeline (that I am lacking). I am going to leave this issue open and add it to the documentation as a known issue (false is not supported)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants