Visibilty of private extensions on Visual Studio Marketplace - visual-studio-extensions

I have created some extensions which we will only use internally in our company. Therefore I have set the Extensions to private.
I assumed that this way the users added to the publisher as "reader" could see the lis of extensions when they use the link to the publisher (i.e. https://marketplace.visualstudio.com/publishers/CompanyXY)
I've noticed that this is not the case and if I want to make the extensions available to our developers I need to provide them the direct link to the extension (i.e. https://marketplace.visualstudio.com/items?itemName=CompanyXY.ExtensionXY).
Isn't there a way that I can make the whole list of private extensions available to the authorized users?
Any hint is highly appreciated.

Visibilty of private extensions on Visual Studio Marketplace
You should create a private gallery for VS extension and then put any private extensions on that gallery for internal developers to use. In this way, we can get a list of private extensions directly.
Visual Studio Marketplace is a public vs extension market. Although private packages can be added, there is no way to add private path to store private nuget packages for internal developers accessing. You have to search the private extensions based on your permission one by one and then install them. On that website, it does not support creating private pipeline which stores all your private extensions based on your requirements.
As a suggestion, you can create a private gallery as Sergey said. This is equivalent to creating a private pipeline for specific personnel to access, which stores any vs extensions you want to provide to internal developers.
1) create a shared folder that can access to your internal developers.
2) put any private vsix files into the folder
3) download PrivateGalleryCreator.exe and then copy PrivateGalleryCreator.exe into the folder.
4) click to run the PrivateGalleryCreator.exe on the folder to generate the feed.xml file.
5) enter Tools-->Options->Environment-->Extensions. Click Add, rename the new gallary and copy the full path of the feed.xml into URL.
Remember to click Apply to enable the URL. And let any of your internal developers add the file path from the private shared folder into their VS IDE to enable the gallery.
You can see a list of your private extensions and you can install any of them under it.
What if some developers have already installed the extension via
Marketplace? So they probably need to uninstal and install it again
from the private gallery.
If you want to enable the private gallery, you should first uninstall the installed private extensions on your VS IDE, remove them on the VS marketplace, instead, put them on the private gallery's folder and install them in that.
==================================
Private extensions under VS marketplace:
Regardless of whether private or public extensions are stored in a large container, the extensions can be seen according to the corresponding permissions. You need to manually query and install them one by one. You can never get a whole private package list.
Private gallery:
It is equivalent to creating a private container, storing all private extensions, and directly accessing the container to get a list of whole private extensions.

You can use a private gallery for extensions instead of the Marketplace: Private galleries.

Related

How to use the Storage Attach Service for public storage access instead of private storage access?

Problem Summary
My app (in development), when run on the desktop, can both:
Write to & read from private storage
Write to & read from public storage.
However, when run on Android, only private storage is accessible.
How To Replicate The Issue
Instead of sharing excerpts of my project's codebase, let me refer to another codebase we share and have - the gluon-connect-file-provider project in Gluon Samples. The sample apps only demonstrate private storage usage. None demonstrate public storage usage, so in the gluon-connect-file-provider project, you can make the following change in com.gluonhq.samples.connect.file.Main.java:
Before
static {
ROOT_DIR = Services.get(StorageService.class)
.flatMap(StorageService:getPrivateStorage)
.orElseThrow(() -> new RuntimeException("Error retrieving private storage"));
}
After
static {
ROOT_DIR = Services.get(StorageService.class)
.flatMap(s -> s.getPublicStorage("Gluon"))
.orElseThrow(() -> new RuntimeException("Error retrieving public storage"));
ROOT_DIR.mkdir();
}
When starting the app on the Desktop after this change, you can first observe the directory ~/Gluon being created on your machine. Then, as you toggle the checkbox on/off in the app's Object Viewer screen, you can also confirm the underlying JSON file ~/Gluon/user.json is being updated. So, therefore, we can agree public storage works.
However, when deployed to Android, we can see file-permission related failures in the scrolling terminal during mvn -Pandroid gluonfx:nativerun. First, the Gluon directory fails to be created at startup and, consequently later, attempts to write the user.json file occur.
I thought the soluton was to define in the project the file src/android/AndroidManifest.xml. The default found at target/gluonfx/aarch64-android/gensrc/android/AndroidManifest.xml does not include the following permissions:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
So, I copied the generated AndroidManifest.xml file to src/android, including these entries to it. Even though the Android Settings shows me my app has Storage Permission, this still didn't resolve the problem.
Note - when preparing this post asking for your help, I noticed that, without also provisioning src/android/AndroidManifest.xml file with EXTERNAL READ/WRITE permissions for the gluon-connect-file-provider, the Android device already showed the deployed app had Storage Permission enabled.
I used two different Android devices to test with.
Pixel XL running Android version 10.
Samsung S9 running Android version 10.
I tested with the latest GluonHQ Attach dependency 4.0.13 and also with the oldest I found available, 4.0.7.
Is there something more that must be done for the Storage Attach Service to allow public storage access on Android? Please tell me how else to modify the gluon-connect-file-provider app to make it so, thank you.
Resolution
Update to Gluon Attach 4.0.14.
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>storage</artifactId>
<version>4.0.14</version>
</dependency>
With this update, Storage Service will allow you to access pre-existing Android folders, like "Documents" for example. Or, as seen in this post's code excerpt above, you can define your own new directory like "Gluon", or naming the folder after your own App.
Extra
Another cascading result of this Attach update is, in addition to Storage Service, file sharing via the Share Service is now available on Android. Its JavaDoc states Storage Service as a requirement to use Share Service. Below is a quote from its documentation:
Note that on Android, the file has to be located in a public folder
(see StorageService#getPublicStorage), or sharing it won't be allowed.

F#: How to test internal modules from another project?

I follow the best F# practices from .Net documentation:
I create a project for the Application (console, not library)
I create a project for the Tests (with Expecto but doesn't matter)
Problem: Some of my Application modules are not exposed via the internal keyword. Thus I cannot import these modules in my Tests project.
=> How can I perform unit testing of these modules? Should I remove the internal access control?
Thanks!
To test internal, you can use InternalsVisibleTo, to test private classes, you can link the files in your test project (when you are in the "add file" dialog, you can select link, instead of open).
However, as already has been commented, generally you would only test the public interface. But occasionally you want to separately test complex internals as well. For instance in the .NET runtime libraries, this is often done (there are a lot of complex internals), and they use the linking approach a lot.
Since private really means private to the class, and you won't even be able to access such members from an extension method, you should put such members in their own private class, as public members. That way, when you link, the class is accessible, and the members as well, but neither are accessible in your production version.
Use this technique sparingly, because it will bind your private details to the test system, and you won't be as free to change the internal implementation.

Magnolia templates not published from Author to Public

I installed two instances of magnolia and converted one of them to public to receive publishing from the first instance.
I followed the hello-magnolia tutorial (from this link on the official site), created the template on the author instances and the page was created and previewd successfully. However, when it is published it appears on the public instance as unknown-template and generates an error. I copied the hello-magnolia module from the modules directory on the author instance to the public instance and the problem was solved.
When I followed the same tutorial but on a downloaded bundle, I did it not copy the template manually and it was published successfully.
Why do I have to copy the templates manually from author to public now and how I can have the same behaviour like the downloaded bundle?
Since you don't link the tutorial you are referring to, one can only guess.
Quoting from one I've found "Magnolia continuously scans the file system folder defined by the magnolia.resources.dir property." Most likely reason for both author and public instance seeing templates instantly in case of tutorial is that both instances have the above mentioned property set to point to same directory.
In case of separate instances in your latter installation, this is most likely not the case. To change it (assuming both instances are running on same VM or share a network drive) you need to point them both to the same directory. The property magnolia.resource.dir can be set in magnolia.properties file located in the webapp representing each instance under WEB-INF/config/default/magnolia.properties.
That said, it is not necessarily best practice to point both instances to point to same version of files. If you do so, you might be limiting yourself in some scenarios. Say you are preparing some campaign or new version of the web and want to have new templates already available in author for editors while on public you want to maintain current view ... if both point to same folder you can't do so. OTOH maintenance is simpler and there's no errors caused by forgetting to update templates in each of the instances ... just saying so you know how the choices you make affect what you might be able to do in the future.

How to access public download folder in every platform in Xamarin.Forms

I need to create a backup service so I intend to save the SQLite database file on each platform. The saved file should be available after the uninstall of the app.
I intend to use the Downloads folder (which should be available on every platform).
I have created an interface and use the following code per platform:
Interface:
public interface IBackupService
{
string GetDownloadPath();
}
Android:
public string GetDownloadPath()
{
return Android.OS.Environment.DirectoryDownloads;
}
UWP:
public string GetDownloadPath()
{
return Windows.Storage.KnownFolders.???????;
}
What should I do about that? Is there a public library that I could use?
There does not seem to be a general downloads folder as per this documentation on KnownFolders. So your assumption on the Downloads folder being on every platform doesn't seem to be correct.
If we dive in a bit further we get to the DocumentsLibrary which seems the obvious choice for this kind of purpose, but it is not. Microsoft says:
The Documents library is not intended for general use. For more info,
see App capability declarations. Also, see the following blog post.
Dealing with Documents: How (not) to use the documentsLibrary capability in Windows Store apps
The paragraph after that seems to describe what we have to do then;
If your app has to create and update files that only your app uses,
consider using the app's local folder. Get the app's local folder from
the Windows.Storage.ApplicationData.Current.LocalFolder property.
So, as I can extract from your question you only want to use storage for your app, so the Windows.Storage.ApplicationData.Current.LocalFolder seems to be the right choice according to Microsoft.

How can a project under the private node be moved to the shared node?

I have a project which is under the Private projects node in Dynamics AX. I want to move that to the Shared projects node. When I try to drag it to the Shared projects node it is asking me to delete the project and create a new one under the Shared Projects node. Is there any way I can achieve this without deleting and by just moving?
You can create a shared project with the same name as the private project and then move or copy the contents of the private project to the shared project.
In AX, if you are not using any source control, when you have a private project and you drag & drop it on shared, it will move the project. When you will drag & drop one from shared to private, it will copy the project.
If you have TFS a VCS, it will delete and create because the private project XPO will have a new name. In your local repository, your private project os prefixed with your username. It will lost the prefix going shared.

Resources