How do I generate a desktop bridge package in VS2017 without MSB4044 error - desktop-bridge

I have an ATL C++ project I want to add to the windows store.
I followed the instructions here:
https://learn.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-packaging-dot-net
But when I go to build my appx package by right clicking on the project, I get an error:
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\DesktopBridge\Microsoft.DesktopBridge.targets(179,5): error MSB4044: The "GenerateDesktopBridgeAppxManifest" task was not given a value for the required parameter "EntryPointExe".
I added a reference to my project as in the application section, and set it as the entrypoint. However, the tick box doesn't seem to stay applied, even though the project name shows up in bold below Applications.
Inside the Package.appxmanifest this is under applications:
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">...
Should the macros have been substituted at some point?
I also tried by using the project under the C++ section instead of C# as shown in the first instructions, but also got the error.

It appears my problem was caused by a different name being used for the output of the project.

This happened to me and had me searching for some time for a solution to the error which was a total waste of time. This false error occurs when there is actually "real errors" in your project that are not showing. I closed and reopened VS and finally saw the real errors and once I fixed them this false error went away and everything built.
FYI: This happened to me again and reopening VS still did not show the errors. I had to build the offending project and then go to the Output Window to find the error as nothing was listed in the Errors Window.

Related

BC30002 Type 'abcdefg' is not defined Error when building VS 2017

I have a project that is coming up with 5 BC30002 errors, type 'typename' is not defined. However, when I double-click the error to open the offending line of code, intellisence does not show the line as an error, and in fact, when I clear out the name and re-type, intellisence finds the type for me.
One thing I have noticed is that the referenced library in question appears correctly if I remove it and add it back in. It shows the version number of the DLL and "Copy Local" is showing as "True". After I build the project, I then see the version number as 0.0.0.0 and local path is set to "False" (see below). I think this is the root of the problem as it seems that during the build process, it loses track of this DLL.
Any ideas on what might be causing this?
Have you tried deleting your VS folder?
A bit late of a reply but I just had the same issue and resolved it by updating the NuGet packages for the typename. For some I had to then downgrade the packages to their original version (some things were no longer working/present in the newer versions) but in the end the solution build and compiled just fine.

Still getting ITMS-90809: Deprecated API Usage after using --optimize=force-rejected-types-removal

This has been killing me for the last couple of days. I have read everything I can find on this error and have done what xamarin says but it still doesn't work.
I can't get my builds to get through azure pipeline xamarin.ios build and deploy to apple.
When I build locally I get messages like
MTOUCH : warning MT1502: One or more reference(s) to type 'UIKit.UIWebView' already exists inside 'Xamarin.Forms.Platform.iOS, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' before linking
with a companion message that says no references after linking
when I use --warn-on-type-ref=UIKit.UIWebView with the optimize arg.
When I build on azure in my pipeline, I only see the MT1502 but nothing saying anything after linking. The build gets submitted to Apple and fails because of the ITMS message.
I don't know what to do. I am using the latest macOS vm image, mono 6.8.0.123, xamarin.ios 13.16.0.13, xcode 11.4.1. The pipeline worked fine before April 30 deadline, now no matter what, I can't get the linker to strip UIWebView.
Let me know what other info would be helpful. I am completely stuck at this point.
Thanks.
I just got my build to pass Apple's inspection.
What ended up working for me was building locally and packaging the ipa file. On my mac I then changed the ipa extension to zip and unzipped it. I used terminal to go to the YOURAPPNAME.app "folder" and used grep -r UIWebView . to search for references. Don't forget the . so it searches the current directory. I missed that at first and got some message that grep was listening on stdin.
For me that resulted in a line like this:
Binary file ./Frameworks/PersonalizedAdConsent.framework/PersonalizedAdConsent matches
Now, the important thing to note is the linker never warned about this, so I was completely unaware of it. In my case it was part of Firebase/Admob. I was only one release behind and updating to the latest fixed my problem.
I still am using --optimize=force-rejected-types-removal --warn-on-type-ref=UIKit.UIWebView -warnaserror:1503 as my mtouch args. But builds now get through.
I hope this helps point you guys in the right direction, I've spent the last 3 days just trying to get builds to upload reading every post I could find on the web on this problem.
Solved !! I had to update the way how nugets are included to the iOS project .csproj file. The problem was that linker despite the --optimize=force-rejected-types-removal flag was not removing the UIWebView component form Xamarin.Forms 4.6 probably because it did not see it.
My project was created over two years ago and I was still using the packages.config file. After the update the flag started to work and grep query returned 0 :). The best way is to compare the old .csproj file with freshly created iOS project .csproj file and see how VS is referencing nugets.

How to get rid of often occurring git error: patch failed / patch does not apply?

First a little context to the problem:
My work can be divided into two categories:
Maintaining ASP.NET Web forms legacy projects
Building new ASP.NET Core 2/3.1 projects
When maintaining the web forms legacy projects, I get often a Git error the last couple of months. The following error occurs when I try to stage/add parts of code through GitExtensions:
error: patch failed: [FileName].aspx.cs:[LineNumber]
error: [FileName].aspx.cs: patch does not apply
The message is added with some code where the actual patch fail occurs (see example later in this post).
As mentioned before, the error only occurs in the web forms projects and this is the only correlation I can find between the errors. It seems that the error occurs at random pieces of code in random files that I try to stage/add.
I use the following tools for source control:
The most recent version of Git (2.25.0)
The most recent version of Git Extensions (3.3.1.7897)
Repositories are hosted by Bitbucket and developing happens in the most recent version of Visual Studio Professional
I already tried the following to solve the error:
Re-cloned all of my projects
Reinstalled Git
Reinstalled Git Extensions
git: patch does not apply
Example
In the example I tried to stage line 91 and 92. Then the error occurs as can be seen in the left part of the image. But when I stage line 182, everything is fine
I already looked with some colleagues what the problem could be. They also never encountered it and don't know how to solve it.
Oh yeah, a little disclaimer. This is my first post on SO. Please let me know if I didn't provide information in a desired or sufficient way so I can improve upcoming posts.
Kind regards
EDIT
The problem seems Git Extension related. I just installed Source Tree and there everything works fine.

Unable to debug web page code but can debug code in global.asax

When I put a breakpoint on the page_load of the starting page, I receive the following message.
"the breakpoint will not be hit. no symbols have been loaded for this document."
I have seen this before and usually resolve this by cleaning the solution and running it again. This time, however, I am not able to find a solution. What is even stranger about this time is that if I put a breakpoint in global.asax such as Application_BeginRequest, the breakpoint does hit and I can debug, this happens for any page that I add breakpoints to.
If I go to menus\Debug\Windows\Modules I can see that the web app DLL was not built with debug information.
While debugging, 2 things that let breakpoint work correctly consist of .dll and .pdb file. If you look at your bin folder of your project. These 2 files will placed together and must have same "date modified" which mean it was created together while building.
If these 2 files are not created together in whatever reason. Some line-of-code of some files will not hitted by break point. You can also see while debug by navigate to Debug > Windows > Modules. Then find your target dll that you want to debug such as YourApp.dll. Then see in symbol status column. If it work correctly, I will show Symbols loaded.
This may occur in many reasons such as you have changed something in your code (this case may be your aspx file) then you debug without build.
To fix this, You can go to Tools > Options > Projects and Solutions > Build and Run at "On Run, when projects are out of date" set as "Always build" to ensure your project always be built before going to debug.
My issue turned out to be related to the AOP framework PostSharp. I uninstalled it and re-installed it and everything is now properly debugging. By the way I love PostSharp and I highly recommend it. However, I wanted to post my issue and resolution in case someone is experiencing the same issue and is currently using PostSharp.

error: Failed to parse qmlimportscanner output

I have a created a fresh QML quick application using Qt 5.3.2 on Mac. When I build it has 2 link errors.
Failed to parse qmlimportscanner output.:-1: error:
[iphonesimulator-debug] Error 66
I have not even made any changes to default application, why do I get these errors and how can I fix it?
I know this question is pretty old, however, as I just encountered the same error and finally managed to solve it: Your Project Path must not contain spaces for qml quick projects on ios.
Please do not ask me how or why this is the case (as it clearly works for desktop or android deployment), but this was the issue for me. After moving the project to a different location (a folder that does not contain spaces) it would run qmake and deploy just fine.

Resources