UWP and publisher cache not working

Christian Wolf 6 Reputation points
2023-01-09T14:19:44.293+00:00

Hello everybody,

I am currently having some problems getting the "publisher cache"-feature working on two different apps I am developing. The current setup is what I tried to achieve:

UWP application 1:

Has a basic interface for setting up incoming connections via TCP. The frontend interface will start an custom IBackgroundTask. Those background task will listen for incoming connections and creates/modify any folder and file content in an special publisher cache folder (we named it "projects"). To debug, the frontend can search in this "projects"-folder and everything is working as intended.

Application 2:

Using Unity3D and IL2CPP-language to get the application running. On startup, it should search for all subfolders in the "projects" publisher cache folder. It afterwards make some further internal processing of the found data.

Both application have the necessary <Extensions> setup in the appxmanifest.

 <Extensions>  
  <Extension Category="windows.publisherCacheFolders">  
	  <PublisherCacheFolders>  
		  <Folder Name="projects"/>  
	  </PublisherCacheFolders>  
  </Extension>  
  </Extensions>  

When calling ApplicationData.Current.GetPublisherCacheFolder("projects"); in both applications, I got an valid StorageFolder as an result, so it seems to work in both sides. However, when I create an folder in application 1, the second application won't see any generated subfolders in the publisher cache. Application 1 seems to get those subfolders without any issues. For testing purposes, application 2 creates also an new folder (named "test"), which is properly created and shown afterwards (via * await StorageFolder.GetFoldersAsync()* ) in application 2, but application 1 seems to be not able to found this one as well.

Both applications are running on an Hololens 2 (if this information is needed) for the same user and the same publisher (as written above).
Are there any additional things I need to implement to get this feature working?

Thanks in advance.

Universal Windows Platform (UWP)
HoloLens Development
HoloLens Development
HoloLens: A family of Microsoft self-contained, holographic devices that enable engagement with digital content and interaction with holograms in the surrounding environment.Development: The process of researching, productizing, and refining new or existing technologies.
381 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Christian Wolf 6 Reputation points
    2023-01-10T13:57:55.247+00:00

    Hi @Junjie Zhu - MSFT

    many thanks for your reply and providing the examples. I was able to solve the problem, which seems to require an additional step to get an Unity3D app on Hololens 2 working.

    To successfully use the publisher cache between an Unity3D project and an standard UWP app, the publisher certificate in your Manifest Designer -> "Packaging" tab, and "Choose Certificate" must be the same. When click on "build" in an Unity3D project to create an Hololens app, the publisher certificate have some template variables, with "DefaultCompany" in it. Editing the .appxmanifest file manually (by modifying the Identity tag) does not solve the problem. Only editing the certificate via the Manifest designer does the trick.

    However, thanks for your help!

    1 person found this answer helpful.
    0 comments No comments