Problems deploying SecureInput MS Edge Extension native messaging sample - windows-10-universal

I am trying out SecureInput extension sample that demonstrates NativeMessaging capabilities in MS Edge browser extensions and I running into problems deploying the extension after building using VS community edition 2017. I don’t have Universal Windows Platform Apps development experience, so I apologize if there is a pretty obvious answer I am not aware of. But following readme.md in the sample doesn’t work, so posting this question here...
https://github.com/MicrosoftEdge/MicrosoftEdge-Extensions-Demos/tree/master/SecureInput
Steps followed…
Turned on developer mode in “Use Developer Features”
Turned on Enable extension developer features in Edge browser’s about:flags.
Downloaded the sample as a zip file to the local machine.
Copied SecureInput.html to my local webserver
Loaded SecureInput.sln in VS
community edition 2017 Out of two options.. InProc or OutOfProc, I
wanted to try InProc. So needed to select Project in
NativeMessagingHostInProcess in Build Configuration manager. Other
settings used... Debug - configuration; Any CPU – Active solution
platform; NativeMessagingHostInProcess – x64 project platform as I
was using 64 bit Windows and edge running as a 64 bit process as
well; Left rest as default.
With Debug Configuration and Any CPU Solution platform built the entire solution.
Deployment Summary
Built Entire SecureInput solution.
Installed AppX package by running
Add-AppxPackage -register [PathtoSecureInputSolutionFolder] NativeMessagingHostInProcess\bin\x64\Debug\AppxManifest.xml
No errors during building or while running Add-AppXPackage from elevated Power shell prompt.
Expected: At this point EdgeBrowser->MoreOptions->Extensions should list extension installed by AppX package (Deployment Summary/Step 2). =>> Doesn’t happen.
Few other details
I am using 64 bit Win 10 creators build (1703 – OS build 16063.128)
I am suspecting Add-AppxPackage failed to add the extension silently. Verbose flag doesn’t give me any clues either.
Get-AppXPackage shows newly added AppX package.
Name : ae24a957-5239-43b2-a36c-b96805a58ade
Publisher : CN=msft
Architecture : X64
ResourceId :
Version : 1.0.0.0
PackageFullName : ae24a957-5239-43b2-a36c-b96805a58ade_1.0.0.0_x64__2yx4q2bk84nj4
InstallLocation : [PathtoSecureInputSolutionFolder] \NativeMessagingHostInProcess\bin\x64\Debug
IsFramework : False
PackageFamilyName : ae24a957-5239-43b2-a36c-b96805a58ade_2yx4q2bk84nj4 PublisherId : 2yx4q2bk84nj4
IsResourcePackage : False
IsBundle : False
IsDevelopmentMode : True
IsPartiallyStaged : False
I would like to know if anyone got this sample working. If Microsoft Edge folks are monitoring stackoverflow, I really appreciate if someone can jump in to help your early adopters like me. :-)

With offline help from Chee Chen, we were able to figure out why SecureInput was not working. My sincere thanks to him for going out of his way to help. In my specific case, here are the things that went wrong.
URL manifest.json gives permissions to is case sensitive. I had a typo when I first entered the URL in edge browser very first time.. I typed in as SecureInput.html. Try cleaning the cache if you see that using lower case secureinput.html doesn't help.
When instructions didn't work right first time, I used Add-AppxPackage way of deploying the Extension. While doing that, I picked AppxManifest file in NativeMessagingHostInProcess\bin\x64\Debug\AppxManifest.xml instead of NativeMessagingHostInProcess\bin\x64\Debug\AppX\AppxManifest.xml. Something to watch out for and if you make the same mistake, make sure you uninstall the appx package completely and start all over again.
So here are my supplemental instructions for others trying the sample :-)
Make sure you selected right Platform as per your target test machine. Edge runs as 64 bit process so your extension needs to be targeted at that platform.
Make sure right AppServiceName is selected in PasswordInputProtection->Program.cs and Extension->background.js
I think PasswordInputProtection.csproj has a hardcoded Program files (x86) in its path, which will break if you try the sample on 32 bit machine. Edit the project file in notepad and fix it before you try.
Ensure NativeMessagingHost project's Output paths are correctly configured... It needs to be "bin\[Platform]\[Configuration]\AppX\" and not "bin\[Platform]\[Configuration]\"
Avoid typos if you can, because I see very little feedback or verbose logs on why things are not working.

Have you tried following the deployment steps in the documentation? The actual steps and ordering is important:
Build and deploy the NativeMessagingHostinProcess UWP app.
This will generate:
Necessary binaries and files needed for the UWP app.
The AppX folder.
The AppXManifest.xml based on the content of package.manifest. (The content of package.manifest in this sample has been edited to include the necessary entries for Edge extensions).
Build the PasswordInputProtection Desktop Bridge.
This will:
Build the binaries for this project
Trigger a post-build event that will copy the output of the exe to the AppX folder and copy the Extension folder to the AppX folder.
Now that the files are all ready to go, you will need to register the AppX.
There are two ways to accomplish this:
Run Add-AppxPackage from PowerShell: Add-AppxPackage -register [Path to AppX folder]\AppxManifest.xml
OR
Deploy the NativeMessagingHostInProcess project. Visual Studio will run the same PowerShell script to register the AppX from the folder.

Related

Cannot install appx through graphic installer

I'm facing a problem right now and I don't really know how to get more informations about it.
I've converted a desktop application through Microsoft's Desktop App Converter, made some manual modifications about the visual assets, and rebundled it through "makeappx.exe". Then I signed it.
Everything went fine. Except that when I double click the appx to check it, I have the following window:
Appx Error
Which roughly translates as "Couldn't open the appx or appxbundle file" and "Reason: Failure caused by an unknown reason".
This does not helps me a lot :/
However, if I try to install the package through a simple "Add-appxpackage MyPackage.appx", it works perfectly fine.
Could anyone help me find some leads on what's happening here? I've already checked the event viewer as explained here but I couldn't find anything unusual.
Thanks,
Skefrep
It seems the Microsoft team has taken notice of this problem and investigated this appropriately.
-Here is their solution-
The problem can be because when you convert an app with DesktopBridge the resources are signed with the manifest info and store that info in the .pri files you found in PackageFiles folder. Later, when you change something like the Publisher or the Name this signature doesn't match. To fix this you only need to recreate the .pri files.
rm *.pri. Remove the old .pri files.
cd C:\foo\PackageFiles\. Change current directory to the PackageFiles folder. This step is important for the next step.
makepri createconfig /cf priconfig.xml /dq en-US. Create a configuration file for the resources.
makepri new /pr "C:\foo\PackageFiles" /cf "C:\foo\PackageFiles\priconfig.xml". Generate the new *.pri files.
Then you can make the package as usual: MakeAppx, etc.
You can find more information about this problem in "Failed due to unknown reasons" error when you try to sideload a Desktop Bridge app - App Consult Team.

KNIME Command Line Execution - ClassNotFoundException

I'd like to schedule a KNIME workflow. The workflow does its job very good as long as I start it from the KNIME GUI application. When I execute the same workflow via command line, java complains that com.microsoft.sqlserver.jdbc.SQLServerDriver
could not be found (ClassNotFoundException).
I invoke it via:
"D:\Progamme\KNIME\knime.exe" -nosplash -application -consoleLog org.knime.product.KNIME_BATCH_APPLICATION -preferences="absolutepathto\preferences.epf" -workflowDir="absolutepathto\workflow"
Since the error message signals missing content in the java CLASSPATH I also tried to add the parameters
-vmargs -classpath .;"absolutepathto/sqljdbc42.jar"
But still I earn a java slap, pointing to the same error...
I also tried to run the command from within the knime.exe's directory and I also tried to add the JAR file to Preferences -> Java -> Build Path -> Classpath Variable / User Libraries (referenced via the -preference argument). But that had no effect.
Did anybody face the same problems? Maybe with other third party JARs?
It is all about a Database connector that is configured like this:
Does the integrated security maybe force a misleading error?
System spec: KNIME 3.2.2 on Windows Server 2008 R2
Update - extract from preferences file
/configuration/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
/configuration/org.eclipse.ui.ide/MAX_RECENT_WORKSPACES=10
/configuration/org.eclipse.ui.ide/RECENT_WORKSPACES=<list of some workspaces>
/configuration/org.eclipse.ui.ide/RECENT_WORKSPACES_PROTOCOL=3
/configuration/org.eclipse.ui.ide/SHOW_RECENT_WORKSPACES=false
/configuration/org.eclipse.ui.ide/SHOW_WORKSPACE_SELECTION_DIALOG=true
Is there maybe a problem due to the fact that it is a shared KNIME instance among several users and the command line execution does not know which workspace has to be chosen? Is the workspace somehow needed and why?
Partial Solution:
I finally managed it but I don't know exactly why it works now. What I did was to load a fresh portable version of KNIME and ran the same commands only changing the executable path to the new portable version. Before that I started the portable version once to set the workspace directory and register the database driver in preferences dialog and .ini file, nothing else, same configuration so far as the shared KNIME instance. What I am really wondering abpout is that from now on the commands are also working with the shared KNIME instance. I really don't know what caused the change that let KNIME find the driver class.
Info
Because I encountered a few more problems within shared environment in KNIME command line mode, that led to undeterministic execution results, I wrote a little .NET library. This gives me more flexibility/control over the workflow execution (which returncodes and error messages occured and so on). You can find it here if you're interested: KnimeNet
I took a very minimal approach:
cd "C:\Program Files\KNIME"
.\knime -nosplash -noexit -consoleLog -reset -application org.knime.product.KNIME_BATCH_APPLICATION -workflowFile="D:\Work\Knime Workflows\Output\CMD_Test.knwf" -preferences="D:\Work\Knime Workflows\Output\CMD_Test.epf"

Deploy WPF Project to UAT and Prod Environment

I am trying to enable the software tester to install 2 versions of the same application (one UAT and the other Production) on the same computer. I am using Visual Studio 2013 and the exe(installer) is created using ClickOnce. I was able to publish 2 versions to a directory, however, when the tester would try to install the second version it would overwrite the previous version. I did some research and found out that I had to rename the assembly. However, if I rename the assembly , I get the following error
"A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll"
Inner Exception : Could not load file or assembly 'xxx, Culture=neutral' or one of its dependencies. The system cannot find the file specified.":"xxx, Culture=neutral"}
I have tried cleaning, rebuilding , changing the namespace and I have absolutely no idea where I am going wrong. Any assistance will be greatly appreciated!

how to Step through Catel code while debugging ?

After adding Catel implementation to one of my views(mainPage) in my project I have a bug that crashes my Silverlight project. The only indication I have is :" A first chance exception of type 'System.NullReferenceException' occurred in Catel.MVVM " (just about after setting the RootVisual~) - I can't find what I'm doing wrong, and since I am planing on a long-term relationship with Catel I thought that stepping through Catel code might come in handy, so I tried and failed in all the following steps (any help will be appreciated.. because currently I'm stuck and can't find anything):
downloaded catel 3.9 source files (same as my nuget package) and tried building it.. failed with this error :
E:\Dev\Catel-3.9.0\src\Catel.Core\Catel.Core.SL5\Fody.targets(51,5): error MSB4036: The "Fody.WeavingTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with in the project file, or in the *.tasks files located in the "E:\WINDOWS\Microsoft.NET\Framework\v4.0.30319" directory. - trying to search and figure the reasons and overcome this, lead me to nowhere. :(
i have followed this "Stepping through the code" instruction in Catel documentation but noting really happened (I'm using VS2010..is this an issue ?? )
I read this article & readme.md at : https://github.com/GeertvanHorrik/GitHubLink about using GitHubLink to help you stepping through Catel code while debugging. I downloaded the release GitHubLink 1.3.0 from https://github.com/GeertvanHorrik/GitHubLink/releases/tag/1.3.0 ... but running this even with just the githublink.exe -help flag had thrown a exception..
I downloaded the Githublink-master source files but 0 projects were loaded (the GithubLink project file is incompatible with the current version of VS - I'm using VS2010)
can anyone help me either shade some light or:
overcome the build error I receive for catel (no.1)
instruct me how to set & step into catel ?
share the pdb files for Catel libs
It completely depends on the version you are using. If you are using the latest official one (3.9), stepping through the code is only possible by cloning the master branch and building the PDB files yourself.
In the latest prerelease versions via NuGet (the upcoming 4.0 version) you only have to enable the source server checkbox.
Note that you should never have to use GitHubLink yourself, that is for developers only (we run it during the build of Catel).
About the Fody task: it looks like the NuGet packages have not yet been restored on your side. In the lib folder there is a RestorePackages.bat which you can run to restore the packages.
I tried debugging on VS2012 and using Catel 4 pre-release (from Nuget)..
although I believe I did all the right things & settings in VS, I didnt get much further..
So I Opened (using a bin editor) the pdb file that was pulled by Nuget with the DLL, and took a look at the bin file.
the file have strings pointing to the source files at this directory :
C:\ci_ws\WS\1629\source\catel\src\catel/mvvm\catel.mvvm.shared..
So I have created a tree that starts with
c:\ci_ws\ws\1629\source
and downloaded the catel folder to that dir, renamed it from
"Catel-Develop" to just "Catel" in order to feet the location the pdb pointed.
To get things going I also had to add a "Symbol File(.pdb) location" in VS
option-> settings->Debugging->Symbols..(location/server list) to where the nuget download the packages.
in my case.. SolutionFolder\Packages\Catel.MVVM.3.9.0.1406062245-beta\lib\sl50..(I'm using Silverlight)
and then I was able to load the symbols and step/break into the code successfully ..
Maybe I missing something and there is a better way, but this the only way that worked for me..
The only question that still remains for me now is : What is the name of the Catel Github source branch that is matching the pre-release dll and pdb that Nuget is publishing at the moment (3.9.0.1406062245) ?
(I unchecked the general debug settings of : require source files to exactly match the original version)

How to solve 503 error accessing CollabNet Subversion Console?

I'm using Collabnate Subversion Edge.
I'm getting below error when trying to access URL http://localhost:3343/csvn.
Collbnate is set up on Windows Server 2008.
HTTP ERROR: 503
Problem accessing /csvn/. Reason:
Service Unavailable
Powered by Jetty://
How to solve it?
I spent two days fighting with the same problem. It turned out that CollabNet Subversion Edge 4.0.11 does not support Java 8.
The following procedure helped me make CN Subverion Edge 4.0.11 work again on Windows 7:
1) Uninstall CollabNet Subversion
2) Uninstall Java 8 (I had Java 7 and 6 side by side, so after uninstalling the 8, 7 picked up after I added it to PATH variable. It is important to add it at the very beginning of the path, otherwise Windows\System32\java.exe will be taken, which was not good for me also)
3) Install CollabNet Subverion (the important thing is to uncheck the "Run CollabNet ..." check box in the final screen. It looks like the installer is still creating files at the end and only after I have clicked OK in the final screen the needed configuration files have been created in data/conf folder.
4) Make sure that data/conf/httpd.conf file is created. If it is there, got to services (services.msc) and start server manually
Now launch the browser and navigate to localhost:3343/csvn.
Good luck.
1) Install Java 7
2) In file \csvn\svcwrapper\conf\wrapper.conf change from #wrapper.java.command.maxVersion=1.6 to wrapper.java.command.maxVersion=1.7
3) Run \csvn\svcwrapper\bat\runConsole.bat
Good luck.
Check in c:/csvn/data/logs for a log that starts with "console". Then find the error(s) and check what is wrong.
Did you try restarting the service ?
I had the same issue, CollabNet Subversion Edge version 4.0.4. In my case the problem was updating the JAVA_HOME from JDK 1.6 to JDK 1.7.
I finally resolved it changing the file:
C:\PROGRA~1\csvn\svcwrapper\conf\wrapper.conf
I changed the value of the property: wrapper.java.command:java
wrapper.java.command=C:/PROGRA~1/Java/jdk1.6.0_45/bin/java
So the csvn now runs with 1.6 as before. And it works again as a service automatically.
Good luck!!
There's an alternative issue that results in the same error: The database may get corrupted. This is what just happened to me. The above answers where not working in this case. As Subversion Edge 5.0.1 comes bundled with jre8, it would be rather strange if it weren't able to run against it.
To solve the problem, I had to patch the database (luckily, the user database c:\csvn\data\csvn-production-hsqldb.script is a plain text sql file).
Backup files in c:\csvn\data
Delete csvn-production-hsqldb.script and start the service (should come up now)
Exit the service
Save the file which is automatically recreated now
Compare your old file and the new working one
Replace every line starting with INSERT INTO QRTZ in your database with the corresponding lines from the working copy
Copy the new files to the proper place
Start the service
Hope it worked
I had this problem too. Upgrade to SubversionEdge 5.1.4 solved the issue.
We encounter this problem with CollabNet Subversion Edge 3.3.1 every time we patch our JDK 6 install (e.g. IAVM update). We need to install JDK 7 and 8 on this machine also so the installers are confusing the version information in the Windows Registry (not too much of a surprise there). Even if we update JDK 6 last, it gets weird too.
Nevertheless, it turns out the Subversion Console uses the Windows Registry to locate the Java install to launch the Console service. Updating the registry entry HKLM\SOFTWARE\JavaSoft\Java Development Kit\CurrentVersion to 1.6 and having a proper install of JDK 1.6 will restore console operation.

Resources