How to add context menu entries in website projects? - visual-studio-2010

I'm not able to add context menu entries for website project items.
How to reproduce the problem:
Create a VS Package project
Go to the vsct file and replace the groups section with:
<Group guid="guidVSPackage1CmdSet" id="MyMenuGroup" priority="0x0600">
<Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_TOOLS"/>
</Group>
<Group guid="guidVSPackage1CmdSet" id="MyMenuGroup" priority="0x0600">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_PROJNODE"/>
</Group>
<Group guid="guidVSPackage1CmdSet" id="MyMenuGroup" priority="0x0600">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_ITEMNODE"/>
</Group>
<Group guid="guidVSPackage1CmdSet" id="MyMenuGroup" priority="0x0600">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_FOLDERNODE"/>
</Group>
<Group guid="guidVSPackage1CmdSet" id="MyMenuGroup" priority="0x0600">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_SOLNNODE"/>
</Group>
Debug the package and see: This will add an entry for the solution, project and project items in a simple C# project. But when I create a ASP.NET website project (File->New->WebSite) I won't get these entries except for the solution item.
I'm sure this must be possible due to the fact, that NuGet has an entry for the website project item. unfortunately, I was not able to extract that piece of code from the NuGet source code.

After a while I found a solution: (I accidentally looked into the StyleCop source code :P)
<Group guid="guidVSPackage1CmdSet" id="MyMenuGroup" priority="0x0050">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_WEBFOLDER"/>
</Group>
<Group guid="guidVSPackage1CmdSet" id="MyMenuGroup" priority="0x0050">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_WEBITEMNODE"/>
</Group>
<Group guid="guidVSPackage1CmdSet" id="MyMenuGroup" priority="0x0050">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_WEBPROJECT"/>
</Group>
These are not documented on MSDN.
Anyway, I'm curious how NuGet does it, because they have nothing in the vsct file, but an entry in the context menu.

Related

How to enable custom system configuration in Magento 2.3.*?

I am currently working on a Magento project where I have to add a custom system configuration to manage my hosts.
I followed an old configuration I have used in an old project which uses the Magento version 2.2.
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="catalog" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
<group id="config" translate="label" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Setup</label>
<field id="host" translate="label" type="text" sortOrder="67" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Host</label>
</field>
</group>
</section>
</system>
</config>
But starting from Magento 2.3 this solution doesn't work anymore.
Do I have to enable the configuration manually in order to see it in the admin configuration panel?
I tried your snippet and it works fine with me.
Maybe there is a confusion between the Catalog Tab (blue underline), and the 'Catalog Section' (yellow highlight) ?
Tell me if so, i'll give you the snippet that you need.
Inside the section, you are missing the following nodes:
<section ...>
<tab>$TAB</tab>
<label>$LABEL</label>
<resource>$RESOURCE</resource>
</section>

Outlook add-in ribbon icon doesn't show up only on Outlook app for Windows

I'm developing an add-in for Outlook to be used on the Appointments tabs. My issue is that the ribbon icon that initializes the add-in doesn't display the proper icon (ends up falling back to the default blue hexagon from Microsoft) but only on Windows Outlook apps.
The icon shows up properly on Outlook for Mac and on the Outlook web clients.
Tried already resizing the icons to 64x64 and 128x128 (high res), removing and reinstalling the add-in, and validating through the manifest validator. All seems fine but the issue persists.
These are parts of the manifest (URL's replaced with localhost) that I judge relevant to the issue (Please feel free to ask for other sections if I missed anything.
<IconUrl DefaultValue="https://localhost:8080/assets/icon-dark-64.png" />
<HighResolutionIconUrl DefaultValue="https://localhost:8080/assets/icon-dark-128.png" />
<DesktopFormFactor>
<FunctionFile resid="functionFile" />
<ExtensionPoint xsi:type="AppointmentOrganizerCommandSurface">
<OfficeTab id="TabDefault">
<Group id="meetingGroup">
<Label resid="groupLabel" />
<Control xsi:type="Button" id="meetingOpenPaneButton">
<Label resid="paneMeetingButtonLabel" />
<Supertip>
<Title resid="paneMeetingSuperTipTitle" />
<Description resid="paneMeetingSuperTipDescription" />
</Supertip>
<Icon>
<bt:Image size="16" resid="icon16" />
<bt:Image size="32" resid="icon32" />
<bt:Image size="64" resid="icon64" />
<bt:Image size="80" resid="icon80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="messageMeetingTaskPaneUrl" />
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
<Resources>
<bt:Images>
<bt:Image id="icon16" DefaultValue="https://localhost:8080/assets/icon-dark-16.png" />
<bt:Image id="icon32" DefaultValue="https://localhost:8080/assets/icon-dark-32.png" />
<bt:Image id="icon64" DefaultValue="https://localhost:8080/assets/icon-dark-64.png" />
<bt:Image id="icon80" DefaultValue="https://localhost:8080/assets/icon-dark-80.png" />
</bt:Images>
... <!-- Other resources -->
</Resources>
All image URIs, such as those used for add-in commands, must support caching. The server hosting the image should not return a Cache-Control header specifying no-cache, no-store, or similar options in the HTTP response. Find more details here.

nuget vs2015 Cannot Resolve Group Target Dependicies Correctly

I use visual studio 2015 and when I want to use a nuget package(includes .netcore and .net versions both) from my .net45 project that time nuget package manager try to resolve .netcore depencies and failed.What I am waiting if my project is .net45 that time only try to resolve target framework 4.5 depencies but nuget try to resolve .NETStandard1.3 dependecies too. Am I missing something or is this design behaviour of nuget?
nuspec file like that
<dependencies>
<group targetFramework=".NETFramework4.5">
<dependency id="librdkafka.redist" version="0.11.0" exclude="Build,Analyzers" />
</group>
<group targetFramework=".NETFramework4.6">
<dependency id="librdkafka.redist" version="0.11.0" exclude="Build,Analyzers" />
</group>
<group targetFramework=".NETStandard1.3">
<dependency id="NETStandard.Library" version="1.6.1" exclude="Build,Analyzers" />
<dependency id="librdkafka.redist" version="0.11.0" exclude="Build,Analyzers" />
<dependency id="System.Console" version="4.3.0" exclude="Build,Analyzers" />
<dependency id="System.Linq" version="4.3.0" exclude="Build,Analyzers" />
<dependency id="System.Runtime.InteropServices" version="4.3.0" exclude="Build,Analyzers" />
<dependency id="System.Runtime.Extensions" version="4.3.0" exclude="Build,Analyzers" />
<dependency id="System.Threading" version="4.3.0" exclude="Build,Analyzers" />
</group>
</dependencies>
nuget vs2015 Cannot Resolve Group Target Dependicies Correctly
According to the troubleshooting on above comments, you need update your nuget extensions after the 2.12 version. That because starting with nuget 2.12, nuget support full NetStandard and NetCoreApp. You can refer to the nuget release note for 2.12:
•Full NetStandard and NetCoreApp support for VS2013
So, to resolve this issue, please update your nuget extensions first.

Add-In could not be started

I'm currently developing an add-in for Outlook, I followed the basic steps in creating an add in, but whenever I run (the unedited pre-generated) project, I get the following error:
This add-in could not be started. Close this dialog to ignore the problem or click "Restart" to try again.
I first thought this might be related to Visual Studio ISS's HTTPS certificates, but after installing those (and testing that they work in Chrome). I also changed the logo to see if that had any effect but it keeps showing the default image.
Does anyone know what I'm doing wrong? This is my current manifest:
<?xml version="1.0" encoding="UTF-8"?>
<!--Created:ce44715c-8c4e-446b-879c-ea9ebe0f09c8-->
<OfficeApp
xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0"
xsi:type="MailApp">
<!-- Begin Basic Settings: Add-in metadata, used for all versions of Office unless override provided. -->
<!-- IMPORTANT! Id must be unique for your add-in, if you reuse this manifest ensure that you change this id to a new GUID. -->
<Id>d2240a8c-b832-493e-8056-5a14ca48a3f3</Id>
<!--Version. Updates from the store only get triggered if there is a version change. -->
<Version>1.0.0.0</Version>
<ProviderName>DearBytes B.V.</ProviderName>
<DefaultLocale>nl-NL</DefaultLocale>
<!-- The display name of your add-in. Used on the store and various places of the Office UI such as the add-ins dialog. -->
<DisplayName DefaultValue="Test" />
<Description DefaultValue="Test"/>
<IconUrl DefaultValue="~remoteAppUrl/Images/icon64.png"/>
<SupportUrl DefaultValue="https://www.test.com/" />
<!-- Domains that will be allowed when navigating. For example, if you use ShowTaskpane and then have an href link, navigation will only be allowed if the domain is on this list. -->
<AppDomains>
<AppDomain>*.test.com</AppDomain>
<AppDomain>*.test.nl</AppDomain>
</AppDomains>
<!--End Basic Settings. -->
<Hosts>
<Host Name="Mailbox" />
</Hosts>
<Requirements>
<Sets>
<Set Name="Mailbox" MinVersion="1.1" />
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemRead">
<DesktopSettings>
<SourceLocation DefaultValue="~remoteAppUrl/MessageRead.html"/>
<RequestedHeight>250</RequestedHeight>
</DesktopSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteItem</Permissions>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
</Rule>
<DisableEntityHighlighting>false</DisableEntityHighlighting>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<Requirements>
<bt:Sets DefaultMinVersion="1.3">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<!-- Location of the Functions that UI-less buttons can trigger (ExecuteFunction Actions). -->
<FunctionFile resid="functionFile" />
<!-- Message Read -->
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<!-- Use the default tab of the ExtensionPoint or create your own with <CustomTab id="myTab"> -->
<OfficeTab id="TabDefault">
<!-- Up to 6 Groups added per Tab -->
<Group id="msgReadGroup">
<Label resid="groupLabel" />
<!-- Launch the add-in : task pane button -->
<Control xsi:type="Button" id="msgReadOpenPaneButton">
<Label resid="paneReadButtonLabel" />
<Supertip>
<Title resid="paneReadSuperTipTitle" />
<Description resid="paneReadSuperTipDescription" />
</Supertip>
<Icon>
<bt:Image size="16" resid="icon16" />
<bt:Image size="32" resid="icon32" />
<bt:Image size="80" resid="icon80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="messageReadTaskPaneUrl" />
</Action>
</Control>
<!-- Go to http://aka.ms/ButtonCommands to learn how to add more Controls: ExecuteFunction and Menu -->
</Group>
</OfficeTab>
</ExtensionPoint>
<!-- Go to http://aka.ms/ExtensionPointsCommands to learn how to add more Extension Points: MessageRead, AppointmentOrganizer, AppointmentAttendee -->
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="icon16" DefaultValue="~remoteAppUrl/Images/icon16.png"/>
<bt:Image id="icon32" DefaultValue="~remoteAppUrl/Images/icon32.png"/>
<bt:Image id="icon80" DefaultValue="~remoteAppUrl/Images/icon80.png"/>
<bt:Image id="icon128" DefaultValue="~remoteAppUrl/Images/icon128.png"/>
</bt:Images>
<bt:Urls>
<bt:Url id="functionFile" DefaultValue="~remoteAppUrl/Functions/FunctionFile.html"/>
<bt:Url id="messageReadTaskPaneUrl" DefaultValue="~remoteAppUrl/MessageRead.html"/>
</bt:Urls>
<bt:ShortStrings>
<bt:String id="groupLabel" DefaultValue="Test"/>
<bt:String id="paneReadButtonLabel" DefaultValue="Test"/>
<bt:String id="paneReadSuperTipTitle" DefaultValue="Test"/>
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="paneReadSuperTipDescription" DefaultValue="Test"/>
</bt:LongStrings>
</Resources>
</VersionOverrides>
</OfficeApp>
Screenshot of the error:
The most likely cause of this error is a timeout. Your add-in has 5 seconds to execute the Office.initialize method before Outlook tosses up an error.
Generally when this happens, it is because you're not referencing the office.js library in the <head> or your not executing Office.initialize until after the DOM is loaded.
You can find details on referencing office.js # Understanding the JavaScript API for Office
In the XML manifest file that you posted, there are 9 occurrences of ~remoteAppUrl. If you haven't already done so, you should replace each occurrence of ~remoteAppUrl with the HTTPS URL that represents where the add-in's (web app) files are deployed.
Also, as #Slava Ivanov mentioned in the comment above -- I believe each AppDomain value should be a URI that includes the protocol (ex: https://www.test.com).

Pinning Task Pane in Outlook Add-in

I am following this help document
To try and figure out how to pin the task pane, I added the Action, as shown in my Manifest here....
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgReadCmdGroup">
<Label resid="groupLabel"/>
<Control xsi:type="Button" id="msgReadPaneButton">
<Label resid="msgReadPaneButtonLabel"/>
<Supertip>
<Title resid="msgReadPaneButtonTitle"/>
<Description resid="msgReadPaneButtonDesc"/>
</Supertip>
<Icon>
<bt:Image size="16" resid="icon-16"/>
<bt:Image size="32" resid="icon-32"/>
<bt:Image size="80" resid="icon-80"/>
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="readPaneUrl"/>
<SupportsPinning>true</SupportsPinning>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
But, when I go add it into my outlook to test, I get the following error...
This app can't be installed. The manifest file doesn't conform to the schema definition. The element 'Action' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides' has invalid child element 'SupportsPinning' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides'...
I have tried searching for the error itself, and cannot find any possible solutions as to why its not working.
EDIT:
I found out I needed to set the version to 1.1, in which I tried:
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
And from that, got...
This app can't be installed. The manifest file doesn't conform to the schema definition. The element 'OfficeApp' in namespace 'http://schemas.microsoft.com/office/appforoffice/1.1' has invalid child element 'VersionOverrides' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides/1.1'. List of possible elements expected: 'VersionOverrides' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides' as well as any element in namespace 'http://www.w3.org/2000/09/xmldsig#'...
To use pinnable taskpane feature you need to set version overrides to version 1.1 See more at VersionOverrides element
EDIT:
You probably missed the point: "The SupportsPinning element is defined in the VersionOverrides v1.1 schema, so you will need to include a VersionOverrides element both for v1.0 and v1.1."
Please compare you manifest file with the demo manifest you may find over there: command-demo-manifest.xml

Resources