How is it possible to create and build some activities as dynamic link library (DLL) which can be used in other apps.
Imagine I develop an android app in xamarin that has some activities. I want to import some other activities later in main app after I published it. This means that for example when a user purchases a special possibility in my app then app downloads related dll (that contain activities, resources, . . .) and placed it in proper app stored data folder which after that app can uses its contained components.
Unfortunately you cannot create something like "plugin-DLL". You can create a separate app that will act as a "extension" and call its services from your app. A tutorial on how to do this is available for exmple in this blog post.
Related
I'm currently developing a UWP application that now needs access to APIs that are normally not accessible by apps in an AppContainer.
As I'm not (yet) able to migrate to WinUI3, I want to try using DesktopBridge to do the otherwise restricted work.
As both processes have to communicate with each other, I thought of COM as it should make things relatively seamless once everything has been set up.
According to this page this should be possible using "Packaged Com".
I now have...
An Out-of-Process Com Server (c# net5.0) that is accessible by non-packaged win32 apps (e.g., PowerShell) but not my own UWP App.
The UWP App with the main logic and UI.
A Packaging Project, which creates a package out of both projects.
(Manifest)
The code is on GitHub: Repo.
Does someone have an idea how to solve this problem or got an alternative for IPC?
PS: Tutorials I used
Packaged Com
Out-Of-Proc COM in c#
Packaging / DesktopBridge
So if I understand you correctly, you want to communicate between a UWP app and a Win32 app, and these two apps are packaged inside a Windows Application Package Project. Please let me know if it is not correct.
For your scenario, since the two apps are packaged together with desktop bridge, I'd suggest you use the App Service. App service could be used not only between UWP apps but also between the UWP app and desktop app.
These are the detailed steps:
You need to declare the AppService connection in the Manifest file of the package project.
You need to call the App service API in the win32 application.
You need to handle the connection in the App.xaml.cs in the UWP app
You could check the detailed code and sample from Stefan Wick's blog - UWP with Desktop Extension – Part 3.
I'm developing a WPF application, I added a custom WinRT component (implemented in UWP) and I'm hosting this win10 component in the WPF app, via XamlHost. I followed every step of the documentation, my custom controls are implemented in a UWP app project instead of a UWP class library. The app runs well and the UWP components are displayed properly in the WPF application. I could create the app package, but when I uploaded to the Microsoft Store (the .msixupload file), the following error was thrown:
Package acceptance validation error: You cannot submit pre-compiled .NET Native packages. Please upload the Microsoft Store appxupload file and try again.
What they mean pre-compiled .NET Native packages?
I also checked the sample application, which contains a winrthost.dll for different architectures. However the documentation doesn't mention this, I also added to my UWP project and configured as it is in the sample app's .csproj file. I tried to remove this dll file, but the store still doesn't accept the build.
As I removed the reference to the UWP App project, the Store accepted my build. As I re-added the reference (without using any component from it), the Store rejected. So I think the problem is in the custom UWP app, but what could be a pre-compiled .NET Native package here?
Update:
I added a new empty UWP app project to the solution, just set up the XamlApplication and referenced it from the WPF application. The UWP component shows in the WPF (I added just a green rectangle), but when I tried to upload to the store, it displayed the same error message.
As the documentation says, also tried to create a UWP class library instead of the UWP app. Created the build and the store accepted... What is the difference?
The documentation says:
You can alternatively define the custom control in the UWP app project
you created in the previous section. However, these steps do this in a
separate class library project for illustrative purposes because this
is typically how custom controls are implemented for portability.
So, theoretically it would be possible to publish a WPF app with a custom WinRT component hosted in a UWP app, right? Then why the store doesn't accepts?
After one day of investigation, I found that the solution is just to add the UWP app as a reference to the Packaging project (not just to the WPF app).
As I added to the references, the Store accepted the build. More details here.
i have referred following link to create bot and deploy it into microsoft teams
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/create-a-bot-for-teams
But when it need add manifest.json file in Microsoft teams,i did not get manifest.json in c#.net
How do i get manifest.json file in c#.net
Manifest file is the zip file that will contain a json file which lists out all the capabilities your app offers and the two icons of the app. You could use App Studio to create your app manifest. Or you can sideload the app manifest if you have the manifest file ready. Here is a sample manifest file. Please let me know if you need any help.
i have used core bot framework template from Visual studio and created bot, then i did app registration on below url
https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade
Then Used Microsoft app Id and Microsoft password on "https://dev.botframework.com/bots/new" link to create bot and added endpoint as https://113526c2.ngrok.io/api/messages
Then used Microsoft App id and App password in c#.net code , configured Microsoft App id and App password which get from app registartion and endpoint url as https://113526c2.ngrok.io/api/messages on bot framework emulator
But bot is not working on bot framework, why?, Post 400 error display on bot emulator
How to solve it ?
By far the easiest way to get a manifest is to use the "App Studio" app in Teams. App Studio is an actual app, in the store, from Microsoft, that you can use for a bunch of things. One of those is to create a new app for Teams, inside of Teams. It has a proper GUI so you can create your app definition, modify and update it, etc., and then export the manifest when you're done. It will generate a zip file, which contains the manifest itself, as well as your app's icons.
However, while you're still building the app, App Studio helps you to deploy (and redeploy over time) the app manually into your own context (e.g. a 1-1 bot, or into a group chat or a Teams channel). It's also got some validation in as you're going to check that you've entered things correctly.
So, in short, very highly recommended for building apps for Teams, and comes directly from Microsoft. As an extra bit of info, you need the ability to side-load custom apps to be able to deploy your apps into Teams using App Studio.
I have an existing project for Windows 10 (UWP).
It creates an app that can go into Windows Store and be sideloaded, and that works fine.
... but now I would like to create a desktop-version (an exe-file) from the same code base (to avoid sideload-security issues in local network).
I created a VS 2015 4.5.2 WPF project and started to reference the components (dll's) used in the UWP project. But the importer states that some of the components depends on .Net-Core, and cannot be referenced.
So: Is it possible to mix .NET-Core and .NET-Framework components in the same WPF project?
Or: Can I create a .Net-Core console-app, create the used windows, use XAML, and export an exe (with dependencies) that can run standalone?
Thx!
Unfortunately what you are tying to achieve is not possible.
UWP and WPF are different stacks and unless you are using PCLs code cannot be shared between them.
Even then, the XAML layer is different and not compatible from one stack to another.
So no, you cannot reuse your code in a WPF application
As for the other solution, you cannot have your UWP app run as an .exe because Universal Apps run a different Application Model called appx which is fundamentally different than the exe application model.
There are ways to wrap an exe application in an appx (See the Desktop App Converter) but there is no converter/repackager to take you from appx to exe.
I'm developing Windows Store Universal app that uses Azure to store data.
In Visual Studio, there is four projects (Windows, Windows Phone, Shared, Mobile Service).
In Shared projects there is a class ToDoItem.cs. I want it to be used by all projects to avoid code repetition.
The problem I have is that I cannot add a reference to ToDoNotes.Shared in MobileService project. If I do it the other way round, that is, if I have this class in MobileService and reference it in Windows and Windows Phone projects I hit the same problem.
Is it possible to share this class across all projects?
An Azure project can only reference a classic class library... Universal Apps can only reference portable class libraries so you can not reference the code in this manner... There is one trick left in the arsenal, that is to add the file to both the shared project and the azure project as a link. This will link the file to the azure project Instead of copying the file into the azure project folder directory. See Photo below
The hard part will be trying to use the same code because certain objects have been moved from one namespace to another between universal apps and standard.net such as the XmlDocument, httpclient etc. Your code may have quite a few ifdef statements and this might end up being more trouble than it is worth.
Assuming ToDoItem.cs is like a object model, it should be put in a strongly named class library that can be referenced to from any project