I have a SharePoint 2010 solution in Visual Studio 2013. Every time I close and reopen Visual Studio, a new feature is added to the solution with one list inside it. The list was removed from another feature that it should be in. It is always the same list. As soon as I open the solution this pops up in the Output window before I do anything...
A new feature Feature2 has been added to the project Solution
C:\Code\Solution\Package\Package.package (0,0): Added Feature2 to Package
What is causing this?
I have tried the following:
Recreated the solution and copied all files over - No change
Checked the package and project manifest. - Everything looks okay.
Loaded the project every different way, including unload and reload command. - No change
Recreated the list it likes to isolate into its own feature - No change
Recreated the feature the list should be in but it keeps moving to this new feature - No change
Added a new list and put it after the problem list in the feature - VS then created 3 new features! It took 3 lists out of my feature and put one in each of its own features. I guess I made it angry.
If the lists in the same feature have the same Type ID, the tooling will move the lists into a newly created feature, because the Type must be unique within a feature. You can check the documentation on the ListTemplate element for more information.
It is because features cannot contain list templates that have identical values for Type. This is explained here: https://msdn.microsoft.com/en-us/library/office/ms462947.aspx
Type
Optional Integer.
Provides a unique identifier for the template. This identifier must be unique within the feature, but need not be unique across all feature definitions or site definitions. For a list of the default list template types, see SPListTemplateType.
You will probably find that your Elements.xml file for your list templates contains the same value for Type.
To fix this, you will need to edit the Elements.xml files of the list template and the list instance.
Change the Type of the ListTemplate xml element to a unique integer.
Change the TemplateType of the ListInstance xml element to the same integer
I have started to choose numbers over 1000 to avoid conflicts (Although 1100, 1200, 1220 and 1221 are system types)
Related
Been trying to set up configuration-specific variants of resource .resw files in my project, so I could have have different resource string values in Debug and in Release (and in other configurations).
There are standard facilities in VS to have files conditionally included or excluded from build depending on selected Configuration. I have set up file properties to be Content=Yes and Excluded From Build=No for a file that must be included in a configuration, and the other way around for the other file.
The variants appear as expected in the IDE - only one matching current configuration is active, and another one is shown with Content=False in the Properties view, and with a red icon in the files list. The vcxproj also contains correct PRIResource nodes for .resw files with DeploymentContent and ExcludedFromBuild set:
<ItemGroup>
<PRIResource Include="Debug\Strings.resw">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</DeploymentContent>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">false</ExcludedFromBuild>
<DeploymentContent...
Building this project however fails with a message
error PRI277: 0xdef00532 - Conflicting values for resource 'resw
name/resource name'
Examining intermediate files reveals that both .resw variants are listed in resources.resfiles that is then fed into MakePri.exe . The ExcludedFromBuild setting appears to be ignored.
How would I get this to work? Is there a special way to control the inclusion of resw files? Maybe a different approach to having string variants altogether?
There are apparently "qualifiers" for organizing resource variants, and a naming scheme (https://learn.microsoft.com/en-us/windows/uwp/app-resources/tailor-resources-lang-scale-contrast). There is even a "Configuration" qualifier, though it is not entirely clear which configuration that is, and where at run time I am supposed to take an identifier to select a resource variant I want.
Adding this as an answer for the sake of completeness, as this is relevant and might even be useful to someone. But I am not happy with project configuration concerns being displaced to runtime, with unneeded and possibly sensitive values being added to the package. So I decided to force-emulate ExcludedFromBuild and am picking and copying the single .resw variant I need into build via a Custom Build Step. Shout out to whoever is responsible for this awkward mess at Microsoft.
I have a recorded Visual Studio Load Test (using Visual Studio 2015).
It seems to have recorded fine, but if I just play it back as it is, I am going to get primary key violations.
I have logic like this in my application:
Ask the web service for an ID.
Take that ID and pass it into a save call.
I know that I can put in the value of a "Context Parameter" using {{ variable }} syntax.
But I have not been able to find a way save a value off at run time into a Context Parameter.
Is there a way to take part of a result and then use it for future calls?
The simple way is to add an extraction rule to the request. There are several types of extraction rule for getting different types of data from the response. They are added via the context (right click) menu of the requests. Select the required extraction rule and set the properties as needed.
More complicated extractions can be done by writing your own extraction rule or by writing a Plugin.
If the text to be extracted can be selected in the "Response" tab of the web test execution results then, sometimes, the context menu of that selected text has a "Add extraction rule" entry (I may have mis-remembered the exact wording). If using this then check the rule that is added. It often creates a rule looking for a very short Starts with string and looking for the Nth occurrence. Eg, in HTML the text Value=" is common and the generated rule might be to find the 17th occurence of alue=. The rule may be a good starting point but works better to select the first (ie index 0) occurrence of a longer string.
(Little or nothing has changed between the 2010 and the 2015 versions of Visual Studio as far as the referenced articles are concerned.)
I am using DCP with MS CRM to print documents based on templates. I have multiple templates for different business units. I follow the code during debugging and the Guid is pointing to the correct template. It goes to the printer and prints out the wrong template.
Things I have looked at;
I know its damn near impossible but have two templates fluked the
same Guid? No
Does the correct template have the wrong
information. No
I don't understand why its happening. Right up to the point of printing, the Guid IS the correct Guid for the correct template. When I go to the printer, wrong template with the right merged feilds. And the template is attached to the order. (Which is also wrong)
== UPDATE ==
Looking into the database, there are 2 templates with the same name. However only 1 of them shows in the list in Word so I can not see the content of the other. Still looking for solution.
There were two templates in the database. One of them was inactive and one active. My code was selecting ALL templates with that name and giving back the first or default one.
I changed the code to only select active templates. This solved my problem.
I'm trying to get these parameters while creating a visual studio template but it doesn't return a value, it just stays like this:
string rootnamespace = $rootnamespace$; // this is the output, it just stays as it was declared
string SpecificSolutionName = $SpecificSolutionName$; // this is the output, it just stays as it was declared
According to msdn - Template Parameters:
SpecificSolutionName:
The name of the solution. When "create solution directory" is checked, SpecificSolutionName has the solution name. When "create solution directory" is not checked, SpecificSolutionName is blank.
And I made sure that the "create solution directory" is checked, but still it doesn't give any value.
How can I get these values. please... ?
I also found $SpecificSolutionName$ to be broken. As a work around it turns out the directory of the solution is usually the same as the name of the solution and thus:
If your solution template has only 1 project: the solution and project names are identical and thus you can simply use $projectname$ in lieu of the broken $SpecificSolutionName$.
If your solution template has multiple projects (aka ProjectCollection): add the attribute CopyParameters="true" to the desired ProjectTemplateLink element and use $ext_projectname$ in lieu of the broken $SpecificSolutionName$.
I think the documentation is not enough clear when it comes to multiproject templates. Putting the wizard declaration in the vstemplate of your multiproject definition, and on the project/s that you desired to use to, makes the "broken" variable appears.
This is because, it launch the wizard for each time you declare it, so to speak, and it behaves differently depending on the context.
Pay attention: the variable $SpecificSolutionName$ only has value when executing the first time for the multiproject vstemplate declaration, and only executes RunStarted, ProjectFinishedGenerating and RunFinished methods. So, to use it in a global context you need to figure out some kind of mechanism to mantain the value between Wizard executions, as adding a new key in the replacementsDictionaryor something.
Hope this help.
I fixed this by adding this doctype declaration to the start of my .vstemplate.
<?xml version="1.0" encoding="utf-8"?>
The doctype declaration is not supplied by the template wizard, but is present in all the preinstalled templates. Good luck and thank you for your patience while I researched this question.
$SpecificSolutionName$ is always empty. How can I tell if the user is making a new solution directory or not?
Frustratingly, the docs are wrong in 2 ways.
There is no "SpecificSolutionName". It is "SpecifiedSolutionName".
If the user unticks "Create directory for solution", then $SpecifiedSolutionName$ is not blank as stated; it actually becomes the same as $projectname$. How you determine when this has or has not occurred and whether what you're reading is a unique solution folder's name or not, is another story.
I want to create a fragment file that will only contain a CustomTable in the file. This is easy enough, but I do not know how to link/include it back into the main product.wxs file.
The fragment file is in the same project as the product file, and I have also tried adding an include tag for the file without success, and even putting the custom table into a WiX include file.
Is there a way to do this? Or is it going to have to live in the product file?
The WiX toolset compiles and links in a similar manner to the C/C++ compiler. The linker starts at the "main" entry point (Product element, in your case) then follows the references from there, which in turn follows references from there until all are resolved.
Part of your question is missing but based on the title I'm going to guess that you want a CustomTable element. Typically that CustomTable is processed by a CustomAction. There are a couple good ways to reference a CustomAction.
I would not use an include file.
You could try using EnsureTable if you'd like to make sure the table is created whether or not there is data in it. If you'd like to separate the custom table's schema definition from the data I believe you can just define them in separate fragments and reference the schema definition from the data definition fragment by opening with <CustomTable Id="your table name"> and defining the rows of data within it.
In general Wix won't pull fragments into the main authoring unless they contain elements that are referred to somewhere and since there is currently no such thing as CustomTableRef you may opt to use other elements such as an empty PayloadGroup or ComponentGroup that you can refer to (using a PayloadGroupRef or ComponentGroupRef respectively) from your main Bundle, Product or Module element as the case may be.