Why won't .NET MAUI Run as "Windows Machine" On Different Development PCs - maui

I have a MAUI application that I put into source control; then pulled down and attempt to develop on a different machine; on the second machine, in Visual Studio 2022 I no longer had the option to run "Windows Machine" it was replace with the name of the project and it wouldn't run it attempts to start but breaks in App.g.i.cs with the message
System.DllNotFoundException: 'Unable to load DLL 'Microsoft.ui.xaml.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)'
How do I setup a MAUI application such that I can run it on different development PCs?
Steps to Replicate / Steps to Confirm Issue
To confirm the issue / attempt to see what the difference is I did the following
Machine 1: Create MAUI App from Template (no changes); confirm "Windows Machine" option for debugging; and it runs as expected
Machine 2: Create MAUI App from Template (no changes); confirm "Windows Machine" option for debugging; and it runs as expected
Copy Code from Machine 1 to Machine 2: Windows Machine option not available; application won't start up with above exception
Copy Code from Machine 2 to Machine 1: Windows Machine option not available; application won't start up with above exception
Use Git to compare the two applications: looks like only difference is OpenSans-Regular.ttf and OpenSans-Semibold.ttf and the ApplicationIdGuid ... note if change those values (copy files, change guid) it still won't permit Machine 1 code to have "Windows Machine" Option on Machine 2
Assumption: I'm assuming there is some difference between the two machines that is causing this; but I'm not sure how to determine that difference and resolve; both are running VS2022 17.3.6 64-bit; Xamarin 17.3.0.296; .NET Core 6
It seems the symptom that show the issue is that the MauiApp showing that "Windows Machine" as an optio to run up the application; if the App was created on the Machine you get that; but if you pass that code to another machine you see the csproj name and get this exception
Desired Outcome: My goal here is to have a single code base, committed in Git, that I can develop on two different machines with a MAUI App; no worries if there are settings or similar to support; or if one machine needs updates; just how to determine and get to that state is the issue / question.
Any help on resolution; or what that would happen (note: all non-Maui apps work across these two machines; console apps, windows services, web api, web app etc... commit on one; run on the other; it is only Maui apps having this difficulty)

Resolution: launchSettings.json not put into source control; copy launchSettings.json and everything works as expected
It looks like the issue here was less about the machine this was running on; and more that launchSettings.json were not on the target machine when transferring code
I copied the launchSettings.json from the template created to the target machine and things worked as expected from there.

Related

How to Build a definition and publish test results for a Java project with maven, Junit and selenium on Visual Studios Team Services VSTS

I have an automation script that uses maven POM.xml to import all the dependencies needed from selenium and junit. The main test uses selenium to open a browser, verify some information, close the browser and the test ends.
When run as Junit it works fine: run as Junit test
When run as Maven Test it works fine as well: run as maven test
In both scenarios, the program opens the browser and navigates through the website as it should do for an automated test.
Now I need to integrate it to VSTS so I can visualize the overall pass/fail test on the VSTS dashboard but I'm not familiarized with this tool too much yet.
So far this is what I have managed to do:
Deploy an agent on my WindowsPC (I want to execute and deploy the project on an Azure VM or another azure instance later on) NOTE: this is the same pc I'm successfully running the program using eclipse as shown in the screenshoots above. https://learn.microsoft.com/en-us/vsts/build-release/actions/agents/v2-windows?view=vsts
Create a build definition on VSTS but when I queue the definition the build fails: build definition and the build fail.
I don't know why it can't find mt config.txt file since it is located on the same hosted agent in that same directory. I'll appreciate if someone is capable of guiding me through this process so I can run the program from the VSTS and visualize the overall tests that fail and pass on the VSTS dashboard.
UPDATE: I moved the config.txt file to the public directory and the build was successful(I still need to fix this issue because I do not want my work in a public folder).
Now the problem I have is that even though the build is successful and it looks like it is running my "3 tests", When I look at my pc, nothing is happening. it should open chrome and take a screenshot, then open Firefox and take another screenshot and finally open internet explorer and take another screenshot and save each test on different folders but it is only generating folders for chrome and internet explorer (but still those folders does not have the screenshot I'm asking, maybe because the browser is not being open on the computer.)
Here is the log: https://drive.google.com/open?id=1S_MhAUmzj8i9phPQiqS06s0_1cCRrbF0
test output report generated on my computer
test output on vsts
Look at the error message. The error message tells you precisely what the problem is: java.io.FileNotFoundException: Y:\Automation Team\CopaQA\Architecture\local\config.txt (The system cannot find the path specified)
You need to not rely on hard-coded paths.
You say you registered a build agent against your VSTS account... but did you change the agent queue for your build? If the agent queue is "Hosted", you're using Microsoft's hosted agent.
I don't know why it can't find mt config.txt file since it is located on the same hosted agent in that same directory.
It turns out that Java.IO. can't read files located on a shared network drive, I solved this by using the UNC path to that file (//"computername"/"directory"/"file.txt")
Now the problem I have is that even though the build is successful and
it looks like it is running my "3 tests", When I look at my pc,
nothing is happening.
It took me a little reading to realize that to perform UI tests my agent needs to be set up in INTERACTIVE MODE. it can be done following this guide: https://learn.microsoft.com/en-us/vsts/build-release/actions/agents/v2-windows?view=vsts

How to run scheduled Coded UI Tests on Virtual Machine without having a RDP connection

Situation in short:
Virtual Machine with Visual Studio 2013 installed. PowerShell script
runs on the VM to execute Get Latest, Build and Execute Coded UI
Tests. Windows Scheduled Task to execute PowerShell nightly.
auto-logon is enabled (or I'm doing something wrong?)
yes, I've read post Is it possible to run Coded UI tests without having to connect via remote desktop?
I've seen posts about TCM. Does this help and how can I use it in my
situation?
I made some tests in Microsoft Test Manager and I also executed and recorded them.
I've loaded these tests in a test project (and changed the script providing categories and custom checks).
I then categorized these (as Development or Acceptance).
I executed out using a PowerShell script on a VM (with Visual Studio 2013 installed) with following actions:
Get Latest
Build
Run latest build with a selected set aka category using mstest.exe
So far everything is going perfectly. All the tests pass.
However, when I create a Scheduled Task on my VM run the PowerShell script everything fails because of a missing session.
Do I have the VM (I have no knowledge of Virtual Machines) then unlock or something?
Side-Note:
I also tried to fix this with a Test Agent and Controller, but once I had installed these, all other users of TFS lost their rights, so I prefer not to do this again.
I would be very grateful if you know something that can solve this.
I spent hours on Google finding a solution for this issue, but no solution helped me.
Do I need to provide more information?
The problem you're seeming to have is that the testagent is not setup correctly. You need an active desktop session for Coded UI to be able to run (it needs it to perform all the actions such as clicks).
Microsoft has some nice info about setting up your test agent here.
But to tackle your exact problem of the test failing because of a missing session I'd suggest the following:
Run AutoLogOn.exe from the sysinternals suite (can be found at http://live.sysinternals.com/). It will automatically log in with specified user when the machine starts, and keeps the desktop session active.
Alright...I'm making progress.
I've installed test agent and controller. It's all running fine.
Next I've opened Lab Center on my own MTM to create a new environment.
Test Controller is found, but I receive the message in this post "Microsoft Test Manager cannot install test agent on these machines" when creating new Lab Center environment
File and Printer sharing exception is enabled. I don't get the other message.
I don't understand what is wrong.
Maybe I'm completely on the wrong track and it's not necessary to use the Lab Center.
Then the only remaining issue is the non-active desktop issue.

C++ Builder XE5 - How to turn off Deployment Manager

I apologize if this is not the right place to ask such question, but I'm at my wit's end since Embarcadero's forum won't allow me to post any question there.
I have enabled the "Deploy" feature in the C++ Builder IDE, to test out about the depending dll & bpl files of my application, when I'm done, I found myself trapped in an annoying state - I can't perform any debugging without connected to a remote pc (with their PAServer)! This is causing a HUGE problem for me as I will not be able to debug my application if I'm away from the office, i.e. I'm on a field service at my client's place or at home.
I tried deleting the deployment profile, but it just get recreated every-time I compile my project and there is a DEPLOY command upon running compiling and running the source code. I have to wait until the connection attempt to the remote pc time-out to continue testing the application by manually clicking the .exe of my application.
Is there any way to turn off the "Deploy" feature so that I can do debugging on my local machine just as before activating the "Deploy" feature?
I've found out where the profile was hiding and deleted it, now I can debug as usual.
In the Rad Studio help:
ms-help://embarcadero.rs_xe5/rad/Connection_Profile_Manager.html
On occasion, I have this same problem with DelphiXE5 (where the problem is that I forget how to get back to the default environment without losing my remote settings.)
Remote Deploy active:
The Revert option for the normal build/debug environment:
And finally, the previous Remote Deploy settings available via the same Target Platform context menu (i.e., Properties):
The Default Connection isn't something to be setup. To the contrary, it's really not a connection at all. The Revert... menu item essentially means Revert to local build & debug.

NServiceBus not creating queues automatically (MSMQ)

I'm doing the examples from the NServiceBus website (http://docs.particular.net/samples/step-by-step/) and when I run in Visual Studio everything works and the queues are created automatically (even if I delete them and re-run the solution than they get created automatically). The dev machine runs Windows 8.
I have an emulated Windows 2008 RC2 - when I take my solution bin folder to the server machine and try to run NServiceBus.Host.exe it eventually crashes and the reason is: "The queue does not exist or you do not have sufficient permissions to perform the operation" - even when I run with administrative privileges. When looking the the queue I see that they were not created, and if I manually create the queues than it works.
Why doesn't queues get created automatically when I run on a different machine?
Update
If I run NServiceBus.Host.exe /install than it creates the queues, and also installs it a s windows service. But what I would like to do is run it regularly. If I just run the exe, is it considered as self hosted?
You can run the NServiceBus.Host.Exe with NServiceBus.Integration argument, that should create your queues...
For more info on profiles take a look here
and here
HTH

Eclipse : Whether to select Local Or Shared File during Remote Debugging

I have made some code changes and deployed the code to Jetty Server which is located Remotely .
Accessed the application through browser and I am trying to debug a Application .
Please tell me whether i need to select the Local File Or Shared File from the Eclipse Debug Configurations .
Please see the screen shot here .
The option shown in your screenshot will not help you automatically get code deployed to your remote Jetty.
The option simply allows you to Share your launch configuration (Remote Java Application - ManageWatchlistCall) in your eclipse workspace. This will allow you to checkin the launch configuration in a versioning control system so your colleagues automatically get the sme Remote Java Application launch configuration.
in order to get new code to your remote server, there are only 2 options :
Redeploy your application on the remote server.
Hotdeploy pieces of code to the remote supported (if the server supports it)
Use Hotswap Bug Fixing (works for small fixes) (*)
(*) If you are running Java Virtual Machine (JVM) V1.4 or higher,
Eclipse supports a feature called Hotswap Bug Fixing (not available in
JVM V1.3 or lower). It allows the changing of source code during a
debugger session, which is better than exiting the application,
changing the code, recompiling, then starting another debugging
session. To use this function, simply change the code in the editor
and resume debugging.