-
Notifications
You must be signed in to change notification settings - Fork 51
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
Build fails for a MFCActiveX project #506
Comments
Thanks for finding this! I've opened a bug internally and we'll get this fixed. |
I've this problem too with a C++ MFC x64 app. WebView2 SDK 0.9.622 worked ok. (Where is $(Keyword) defined?) |
I must report the same issue on version 1.0.664.37. Looks like the NuGet package Microsoft.Web.WebView2 1.0.664.37 is configured badly. Version 1.0.622.22 is working fine. |
Seeing same issue with 1.0.664.37. Earlier versions with the same project were fine. I also tried creating a simple test project and adding the nuget package and I get the same error:
Just created new MFC dialog based project, added the nuget project and hit build. |
Thanks for the added info all. I'm upping the priority of this bug. Thanks! |
Can you try this with the latest prerelease SDK, 1.0.721-prerelease? |
I tried my example with version 1.0.721-prerelease and looks fine. |
The build error is gone with 1.0.721-prerelease however now I get an error at runtime that WebView2Loader.dll was not found. |
Looks like WebView2Loader.dll is copied into Debug\x86\ and Debug\x64\ but the exe file is just in Debug. In earlier versions WebView2Loader was copied into the output directory (Debug) without the platform. |
WebView2Loader.dll is platform specific, so requires multiple flavors which are in the x86\ and x64\ folders by default. I'm going to close this specific issue as it seems to be fixed, but @jhandley feel free to open a separate GitHub issue with more specific details about the issue you are seeing. Thanks! |
Reopening this, as we are still get reports of this (see mentions above). |
Hi, I am using VS 2019 and trying to integrate WebView2 in it. For this created a dialog based MFC application and added the latest nuget packages for Microsoft.Windows.ImplementationLibrary (1.0.210204.1) and Microsoft.Web.WebView2(1.0.705.50). Now when i compile the project i am getting the following error Error MSB3030 Could not copy the file "....\packages\Microsoft.Web.WebView2.1.0.705.50\build\runtimes\win-x86\native\WebView2Loader.dll" because it was not found. HelpViewer C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 4846 Have checked and the files are now present in this folder but have a different path. |
How exactly is this problem fixed? I've tried 1.0.790-prerelease and the build error is gone, but the WebView2Loader.dll is not copied to the output folder. Therefore, when I run the program I get this error: I can see the DLL is copied to the folder Debug\runtimes\win-x86\native instead of Debug. The file Common.targets includes this:
So how is this supposed to work? |
The problem is because the DLL isn't copied at all unless
How long would it take to fix this into a new prerelease, allow for |
We've checked in a fix for this and it should be available in the next pre-release package (likely around early March). |
Ok, so where is the file supposed to be? For my WinForms project it is copying it Release\runtimes\win-x86\native in the build folder. Is it still supposed to be in x86 folder? |
Hey, I am running into this same issue on WebView2 SDK versions 1.0.664.37, 1.0.705.50, 1.0.774.44 . It works fine on 1.0.622.22 . If it helps, I would be glad to furnish any other details about my environment/project |
I suppose 1.0.774(.44) is older than 1.0.790(-prerelease), even if it was released after. So since it didn't work in 790 it can't work in 774. There must be another release. But this is taking way to long. It's an error with such a simple fix going on for almost half an year. 😢 |
Apologies for the delay - the fix will be available with the next prerelease package, which should be this week or early next. Thanks! |
This should be fixed in 1.0.824-prerelease SDK package. Please give it a try and let us know if you run into any further issues. Thanks! |
Description
Build fails in a MFC ActiveX project due to copy step in "Microsoft.Web.WebView2.targets" for .NET framework.
Errors:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4651,5): error MSB3030: Could not copy the file "C:\Users[USERNAME]\Source\Repos\ImaWebView2\packages\Microsoft.Web.WebView2.0.9.628-prerelease\build\runtimes\win-x86\native\WebView2Loader.dll" because it was not found.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4651,5): error MSB3030: Could not copy the file "C:\Users[USERNAME]\Source\Repos\ImaWebView2\packages\Microsoft.Web.WebView2.0.9.628-prerelease\build\runtimes\win-x64\native\WebView2Loader.dll" because it was not found.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4651,5): error MSB3030: Could not copy the file "C:\Users[USERNAME]\Source\Repos\ImaWebView2\packages\Microsoft.Web.WebView2.0.9.628-prerelease\build\runtimes\win-arm\native\WebView2Loader.dll" because it was not found.
Version
SDK: 0.9.628-prerelease
Runtime: 87.0.661.0 (Official build) canary (64-bit)
Framework: MFC ActiveX
OS: Win7
Repro Steps
Screenshots
Additional context
Resolution
The problem is due to this ItemGroup condition:
ItemGroup Condition="'$(TargetFramework.TrimEnd(
0123456789
))' == 'net' Or ('$(Keyword)' != 'Win32Proj' And '$(TargetFrameworkVersion.TrimEnd(0123456789.
))' == 'v')"since Keyword for my project is 'MFCActiveXProj'. Changing the line to:
ItemGroup Condition="'$(TargetFramework.TrimEnd(
0123456789
))' == 'net' Or ('$(Keyword)' != 'Win32Proj' And '$(Keyword)' != 'MFCActiveXProj' And '$(TargetFrameworkVersion.TrimEnd(0123456789.
))' == 'v')"fixes the problem.
Does it make sense to you?
AB#29743156
The text was updated successfully, but these errors were encountered: