How do I register Shell Namespace Extension in packaged app? - packaging

I need to deploy a Shell Namespace Extension as part of my packaging project, created by Visual Studio. I see that I can register context menus, property handlers and COM exe and surrogate servers, but not Shell Namespace Extensions for some reason.
Is it possible to register a Shell Namespace Extension in a packaging project?
If not, are there any plans for extending the Package.appxmanifest schema to support them on Windows 11? Or are there any replacement for Shell Namespace Extension provided on Windows 11?

Related

How to register a COM Component with install4j?

I have a COM dll I want to register while installing the application. I am using Install4j. Is there any way Install4j to register the COM component? It maybe possible to use a batch file that includes statement such as "RegSvr32 abc.dll". But It would be nice if install4j has built in support for registering COM components as most of the install makers support them.
As of install4j 5.1, there is no support for registering COM components. You would indeed have to put the regsvr32 invocation into a batch file and call it with a "Run executable or batch file" action.

How can I DllImport a file from resources using VB.NET?

Is there any way in VB.NET to DllImport a dll file from the resources?
I really don't want to add the dll with the executable path.
You can embed a DLL into an executable:
Jeffrey Richter: Excerpt #2 from CLR via C#, Third Edition
Many applications consist of an EXE file that depends on many DLL
files. When deploying this application, all the files must be
deployed. However, there is a technique that you can use to deploy
just a single EXE file. First, identify all the DLL files that your
EXE file depends on that do not ship as part of the Microsoft .NET
Framework itself. Then add these DLLs to your Visual Studio project.
For each DLL file you add, display its properties and change its
“Build Action” to “Embedded Resource.” This causes the C# compiler to
embed the DLL file(s) into your EXE file, and you can deploy this one
EXE file.
At runtime, the CLR won’t be able to find the dependent DLL
assemblies, which is a problem. To fix this, when your application
initializes, register a callback method with the AppDomain’s
ResolveAssembly event.

Convert existing .NET assembly to Windows Runtime Component Library?

How can I change an existing project to build as a Windows Runtime Component library?
Install the VS Commands
IT has an option that
Convert To Portable Class Library
It is now possible to convert C# class libraries to a Portable Class
Libraries. Option is available from context menu on C# class library
projects.
You simply right click over the project file and select 'Convert to Portable Library'.
Depends on the project type. If it's a Class Library, you can go to Project->Properties->Application Tab and choose "Windows Runtime Component" under "Output Type".

HttpModule Native C++ dll in Azure

I would like to run a native httpmodule (c++ 64-bit dll) in windows azure. Firstly is this possible and secondly, what id the best way to go about it?
I have previously used a native dll in azure but wrapped it within a managed c# httphandler which worked fine but this time I would like to host the native dll directly. Is it possible to just host the native dll in azure same as I would in IIS?
I believe you are using a Windows Azure Web Role and on Windows Azure Web Role, native HttpModule configuration with IIS will be the same as and other IIS server the only trick here is that you would be using Startup task to run AppCmd command to install, register and configure your native module.
The basic command you would need in your startup task will be similar to as below:
appcmd install module /name: string /image: string /add:true|false /lock:true|false
For example, to register, enable, and lock a module named ImageCopyrightModule with the .dll file in the %windir%\system32\inetsrv directory, type the following at the command prompt, and then press ENTER:
appcmd install module /name: ImageCopyrightModule /image:c:/%windir%/system32/inetsrv/ imageCopyrightModule .dll /add:true /lock:true
Yes It's possible, I recently had to use an unmanaged C library in my Azure project so what I did was to create a C++/CLI wrapper for it and simply reference it in my C# project.
I believe that's the easiest way to do it, otherwise you'll need to use P/Invoke to call the unmanaged native code directly from C#.
Remember that on the cloud side, Azure uses the 2008 Visual C++ runtime library so you'll either have to compile your C++ project using VS2008, or a better alternative would be to upload the Visual C++ 2010 Redistributable Package to the cloud and silently install it on start-up.
I list the 3 simple steps to do that here If you're interested.

Metro app references and types in Windows 8

I developing C#\XAML metro-ui application. I need some .NET types that doesn't included in .NET for Metro style apps or Windows references (for instance HttpUtility that is located in System.Web). I can't find System.Web via Assembly List. In same time I can refer it via Browse. But as I understand correct isn't it good way and I should avoid this, is it?
Next thing I have found description of Assembly Class. In the bottom of page in Version Information section I can see that it is supported by Portable Class Library. In the sample I see next code
Assembly assem = Assembly.GetExecutingAssembly();
But in my project Assembly doesn't have GetExecutingAssembly method. Is it documentation outdated? or I miss something?
I use Windows 8 Release Candidate and VS 2012
EDIT0: Instead of HttpUtility I should use WebUtility I know it. But I choose this type just for example.
EDIT1: I see public static System.Reflection.Assembly GetExecutingAssembly() via Object Browser but can't reach it.
Metro style apps can only call methods in the .NET Core Profile. You can see the Core Profile reference assemblies on Windows 8 RP machine at ...
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5
You can use ILDasm or ILSpy to view them. See A .NET developer's view of Windows 8 app development video from Build. He talks more about the Core Profile and why some classes, methods and interfaces were removed.