TFS Apply Label - label with name alreay exists - visual-studio

So I'm trying to apply a label to my source in TFS and I'm getting notification that the label name I'm supplying alreay exists.
Now, I agree, the same name exists in another directory in a different solution. So is the label name global to root of TFS?

Label has a concept of scope.
Label names must be unique throughout a specified scope. When you add
a label, you reserve the use of that label name at or under the
specified or implied scope. The default value for the #scope
parameter is the team project, for example, $/TeamProject1.
So under the same Team Project, the Label name is unique. However, you could use a tf label command to change the scope:
#scope</i></p></td>
Specifies a Team Foundation version control server directory within which the labelname is unique. This parameter lets you independently
create, manage, retrieve, and delete one label or set of labeled items
when two labels of the same name are in different parts of the Team
Foundation version control server.

Related

A full explanation for the ResolvedFileToPublish XML element?

By default, the ASP.NET Core SPA project templates have a section in their .csproj files like so:
<!-- Include the newly-built files in the publish output -->
<ItemGroup>
<DistFiles Include="$(SpaRoot)dist\**; $(SpaRoot)dist-server\**" />
<DistFiles Include="$(SpaRoot)node_modules\**" Condition="'$(BuildServerSideRenderer)' == 'true'" />
<ResolvedFileToPublish Include="#(DistFiles->'%(FullPath)')" Exclude="#(ResolvedFileToPublish)">
<RelativePath>%(DistFiles.Identity)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
I'm not finding any good documentation for this on Google, but I think this section might help me with what I want to do. I want to modify it for my own purposes but first I need to fully understand it, so could someone explain to me the following:
Where does SpaRoot get set?
What exactly does ResolvedFileToPublish do?
Where does DistFiles get set?
Where does FullPath get set?
What does the #(DistFiles->'%(FullPath)' "arrow notation" mean?
What does Exclude="#(ResolvedFileToPublish)" do?
What does DistFiles.Identity refer to and where does it get set?
UPDATE: This page gives some documentation on this item but not much:
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/visual-studio-publish-profiles?view=aspnetcore-2.2#selective-file-inclusion
Where does SpaRoot get set?
SpaRoot is set as a property in the project by the template.
Projects contain a "static" portion; that is root-level PropertyGroup and ItemGroup elements.
Note that properties are like a global key-value dictionary (and whenever an XML node in a PropertyGroup defines a property, it overwrites existing ones with the same name).
Items however are like lists; you can add (<MyItem Include="..."/>), remove (... Remove="...") and even update items (... Update="..." in static portions only, no include/remove inside targets means "update all" which you can only filter with a Condition attribute). Items are like objects, they have an "ID" which is called "Identity" and can have other properties, which are called "metadata". The "Identity" is the part that is specified in Include, which may or may not be a file name. If a file is referenced, some well-known metadata is added automatically (such as file modification dates and FullPath). Metadata can also be defined on item XML elements as either attributes (e.g. as seen in Version="1.2.3" on PackageReference items) or as child elements of the item element (e.g. RelativePath as seen above).
What exactly does ResolvedFileToPublish do?
The build is executed in the build engine by running targets that contain logic. All of the build logic that .NET projects run are controlled from MSBuild code that uses the same syntax as the project file. So by using imports or SDKs, the .csproj file itself is a build definition rather than a configuration file. Using mechanisms like BeforeTargets/AfterTargets, one can hook into the build process at specific points to execute code; in this case, the template contains a target that hooks into the publish logic.
ResolvedFileToPublish itself doesn't do anything special. The XML elements tell msbuild to add items to the ResolvedFileToPublish list based on file specifications, one of them only if the project is configured with server-side rendering (which is a property that AFAIK is also present in the static portion of the project in the template).
At a later stage during the build, targets coming from the .NET SDK use these items to compute files to copy during publish operations, tool packaging, and/or single-file publishing (3.0 feature), see Microsoft.NET.Publish.targets for the code that uses #(Microsoft.NET.Publish.targets) to access the list of items.
It is a convention that whenever properties or items are used by Microsoft-/3rd-party build logic that do not start with underscores (_), those are allowed/expected to be configured via build customizations, such as provided in the SPA templates. So we are meant to add ResolvedFileToPublish items which are considered "public API", but not _ResolvedFileToPublishAlways. By adding the built SPA files as items, we can tell the publish logic to include them during publish.
Where does DistFiles get set?
DistFiles is created by this template / logic itself. There is next to no restriction on which item or property names can be used. This could also have been named SpaDistFiles or similar. The template creates some intermediate items it can later use to create ResolvedFileToPublish items and hopes that the name doesn't conflict with any other name used in build logic.
Where does FullPath get set?
Full path is an automatic well-known property that msbuild adds to items that reference files on disk.
While an item's identity could be ClientApp\dist\myapp\index.html (or relative paths containing ..\), its FullPath metadata will be C:\path\to\proj\ClientApp\.....
What does the #(DistFiles->'%(FullPath)' "arrow notation" mean?
While properties can be accessed using the $() syntax, items are referenced using #().
When you have item MyItem with identities A and B, #(MyItem) (when evaluated to text) would be A;B. This could again be interpreted as an item specification, so passed to <OtherItem Include="#(MyItem)" />.
But the #() syntax also allows for item transformations or calling item functions (#(MyItem->Count())). Transformation is a projection of each item to another item, so in this example, #(MyItem->'X') would result in X;X since both items are transformed to the same value. To include parts of the original item, metadata values can be accessed via %(). So #(MyItem->'Hello %(Identity)') would result in Hello A;Hello B, since Identity is default metadata.
In this case, the DistFiles items which contain the path relative to the project file are transformed to reference the full path. While this is not well documented, this is needed since publishing logic expects ResolvedFileToPublish items to contain an absolute/full path since it can also be flown across project references - e.g. a library could contain publish-only assets and the consuming project needs to copy them during publish so it needs to pass the full path and not the relative path, which would not be found in the consuming project.
What does Exclude="#(ResolvedFileToPublish)" do?
An item Include="..." can be filtered to not add items that are part of the Exclude definition.
In this case, the action translates to "Add the full path of DistFiles items as ResolvedFileToPublish items unless there is already an ResolvedFileToPublish item with the same identity (i.e. referring to the same file on disk)".
This is useful so as to not confuse the publish logic with duplicate items. Not sure at the moment if this would actually cause problems, but in order to be a good citizen, it is better not to cause additional file copies / file uploads (web deploy) etc.
The reason the files could already be in there is that they may have already been included by one of the default item specifications defined in the Web SDK that includes e.g. files in wwwroot or similar for publishing, depending on how your project is set up. The template just doesn't want to cause conflicts.
What does DistFiles.Identity refer to and where does it get set?
As mentioned above, items have some default metadata and Identity is one of them. In this case, the DistFiles items are created from file specifications relative to the project, so the item's identities are the project-relative paths (ClientApp\dist\...).
Since ResolvedFileToPublish items contain absolute paths, the RelativePath metadata tells the publish logic where to place the file during publish. You could also use this to rename the files or place them in subfolders.
In a verbose log / structured log, you should see that the items being added are C:\path\to\proj\ClientApp\dist\index.html with RelativePath=ClientApp\dist\index.html and CopyToPublishDirectory=PreserveNewest metadata.
Item batching
In the above code, there is a reference to metadata from within an attribute:
<RelativePath>%(DistFiles.Identity)</RelativePath>
While this tells MSBuild to set the RelativePath metadata to the source DistFiles item's Identity, this also triggers a feature called batching.
For every loose %(Item.Metadata) specification MSBuild sees (note that this only works inside targets) MSBuild groups the referenced item(s) into "batches" having the same property. It then runs the task that this is used in (in our case an intrinsic item add task) once for each batch, in which the #() notation will only yield the items from that particular batch.
When only batching on %(XYZ.Identity), this doesn't really matter and can be seen as a simple "for all".
So to be exact, the <ResolvedFileToPublish Include=... part would translate to: "For each set of DistFiles with the same Identity metadata, transform these items to their full path and, unless a ResolvedFileToPublish with this file name already exists, create a ResolvedFileToPublish item for them with the metadata RelativePath set to the DistFile item's Identity value, and the CopyToPublishDirectory metadata set to PreserveNewest."

How to make fields invisible for stock manager in odoo10

I want to invisible particular fields to stock manager and visible for stock user and Main Administrator(one of the stock manager).
for example:
<field name ="name_ids" groups="!group_stock_manager,group_stock_user"/>
It works but this field is not visible to the main administrator.
how I make visible this field to main administrator?
The thing is that group_stock_manager inherits from group_stock_userso you cannot restrict the first while allowing access to the second group. To solve it you may need to use other group different from group_stock_user to be able to isolate the permissions for group_stock_manager that will not be inherited from group_stock_user
Like Axel was saying you need to isolate the permissions. What you would need to do in your security definitions define the access rights to the field and use base.group_user.
Then create a new security group xml for people who can see and edit the field.

InstallShield: Get the organization name during installation

I'm creating an installation with instalshield.
In the "Installation Interview", (which is part of the "Project Assistant") I set the option "to prompt users to enter their Company Name".
My question is: how can I interact with the value they entered? I mean how can I get it? I need to take this value and insert it to my app config file , during the installation process.
In a more general way, I would love to know how can I add text fields of my own and interact with the values the customers insert?
Thank you,
Noam
Look at the installation Wizard Noam. Anywhere you see an edit control, you will notice that it has a property associated with it. The property is a 'variable' that will have a value assigned to it. You can use the property to populate a registry, an XML file, etc.
I would look through the help documentation for InstallShield relating to Properties.
http://helpnet.flexerasoftware.com/isxhelp19/helplibrary/IHelpISXPropertiesUse.htm
The link above goes over the difference between Public and Private properties and how you can use them.
Ok, so I sort of solved it, I didn't use any built in dialog boxes, but simply created my own public property and dialog, then added an event to dialog and finally read the property value with powershell script, in more details (for future noobies) :
Create new property in Property Manager (under "Behavior and Logic"), give it a name and default value.
Create new dialog (under "User Interface").
At the behavior section of your dialog go to "Next" control (for example).
Add event (by pressing the tiny green plus sign at the line of the "Events")
Choose "SetProperty"
At the SetProperty line you can specify a condition, for example ApplicationUsers = "AllUsers"
At the "Property" field enter the property name (from first instruction)
At the "Value" field enter the value you wish for.
For getting the property value from powershell, create powershell script with the following: $value = Get-Property -Name PROPERTY_NAME
That's it.
This is not exactly what I asked for in the question but I believe this answer is more general and so also contains the answer to my original question.

HP-UFT configure settings for capturing of Object Repository

Is it possible to customize/configure the Capture features in HP UFT Repository manager (Tools: "Navigate and Learn", "Spy" and "Add").
When capturing the object I would like to define what HP automatically sets as the name and test object properties.
For instance if property Help Text if available for an object, set this to the name.
The way UFT determines what name to give an object is controlled by the tag query name in the registry.
The default value is logical name but you can change it to any other property supported by the object's GetROProperty.
In order to configure open regedit and go to HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTest Professional\MicTest\TestObjects.
Then under the object you want (e.g. Edit) change tag query name from logical name to the property you want (e.g. placeholder).
If the object in question is web-based and the property you want isn't supported by UFT you can use the attribute/ notation
UFT has a 'Tools' > 'Object Identification'. Choose the object to modify, then add the property to the 'assistive' list.

Alternative for Folder.WellKnownFolderName for older Exchange versions

I use Folder.WellKnownFolderName to detect folder type, but it was introduced only in Exchange 2013. Also it doesn't work with "Clutter" folder. Can i use another Folder property to determinate exchange folder type?
Take a look at the FolderClass property. That tells you the type of folder (Mail, Calendar, etc.).
Iterate through all the WellKnownFolderNames you care about, and fetch the corresponding Folders individually by passing Folder.Bind a FolderId created with the constructor that takes a WellKnownFolderName. The FolderId of the returned Folder will have its unique ID set. Then just keep track of the FolderId-to-WellKnownFolderName mapping.

Resources