-
Notifications
You must be signed in to change notification settings - Fork 54
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
[NET] Remove unnecessary files from output folder #461
Comments
Thanks for filing! We're tracking this on our end and will take a look. |
@Symbai The
The
You could modify the |
Thanks @cgeier for the added context and the workarounds! When a specific platform is targeted (as opposed to AnyCPU) our default targets file shouldn't be copying over the unnecessary bits. We'll work to get this fixed. |
That's not a fix, just a workaround. The files are getting recreated on every time I publish the files. So I have to delete them over and over and over again. Modifying the files is not a fix either. As soon as I update the nuget package its lost. A fix is to detect if the user publishes in AnyCPU. If not, only include the files which are relevant. |
I've tried to work around this for now by doing a There's probably a better way to do this, but this is what I'm using for now: <Project>
<PropertyGroup>
<!-- ... -->
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
<!-- ... -->
<ItemGroup>
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.674-prerelease" GeneratePathProperty="true" />
</ItemGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
<!-- Remove WebView2 native files we do not need. Only keep the x64 file. -->
<ItemGroup>
<Content Remove="$(PkgMicrosoft_Web_WebView2)\runtimes\win-x86\native\WebView2Loader.dll" />
<Content Remove="$(PkgMicrosoft_Web_WebView2)\runtimes\win-arm\native\WebView2Loader.dll" />
</ItemGroup>
</Project> Note that I'm using the |
For WinForms 1.0.674-prerelease I see this extra folders (strictly x86 build): In root folder I have only:
No WebView2Loader.dll. My questions:
|
Could you explain what you mean by "app must run normally with no WebView2 runtime installed" and are your requirements around extra folders only if they are unnecessary? |
Thank you @champnic
So,
Sorry for a bit confusing here. It was written while I was thinking that
Am I understand right, that when we explicitly target for example WinForms x86 , we will only have this in output (no folders):
Or something else? |
You're right, I've added a note to our bug to also limit WPF/Winforms.dll when the other is used. Current design is that WebView2Loader.dll would still be in a runtimes... folder. This matches Nuget guidance for architecture specific runtime files: Is there a reason you can't have folders? |
We have complex on the fly version management (user can switch between version on the fly in any direction with almost no limits). And this apply strict restrictions on app folder structure. Of corse we can add subfolders, but each of them must be processed separately. So it's more ease for us to simple put WebView2Loader.dll in the root folder. It's can be done with many ways, so no mind. I just wanted to know what to prepare for ... |
Hi Everyone, This was addressed in the 1.0.707-prerelease version. |
I've tried 1.0.707 and didn't closed the issue because it is NOT fixed. At least for me, if I publish my x64 WPF app. I still see x86 and arm64 folders with WebLoader.dll's in it 🤷♂️ |
@pagoe-msft The only change from previous behavior is that Must be (if take into account what @champnic said above about runtimes folder): WinForms
WPF
P.s. Nice technique to manual reference any dll from nuget package content are described here. |
/cc @champnic @pagoe-msft |
Verified the issue still repros, sorry about that! |
I have a similar problem but perhaps it's slightly different, you can find details here: #709 Due to some issue in WebView2's build targets the native DLLs either cause NuGet build warnings (#710) or you get extra DLLs package into your own NuGet package. I think it's slightly different from this bug here but the root cause could very well be the same. |
Just want to confirm that |
The funny thing is that you don't need the x64 directory either 😄 It's not using, |
This should now be fixed in 1.0.781-prerelease. Please give it a try and let us know if you run into any remaining issues. Thanks! |
We're still seeing both the
|
@billybooth I've just opened that as a separate issue to make it easier to track and opened a new bug on our backlog. Thanks! |
Description
I've published a WPF .NET5 app within VS and enabled single file mode. For publishing I had to provide a target runtime (win-x64). In my project I've specified a platformtarget x64 for release mode.
After I've published the app the following files are created:
Why is there an x86, arm64 folder and two WebView2Loader.dlls when my application is 64bit exclusively? They shouldn't get copied to publish folder.
Version
SDK: 0.9.628-prerelease
Runtime: Canary 87.0.644.0
Framework: WPF
OS: Win10
DotNet
Repro Steps
Screenshots
AB#29511846
The text was updated successfully, but these errors were encountered: