BizTalk 2013r2 (Visual Studio 2013) - Default Property Schema configuration - visual-studio-2013

I'm developing in BizTalk 2013R2 using Visual Studio 2013, trying to create a property schema based on a large, lengthy source schema using Quick Promotion, however I'm having difficulty getting the created property schema generated properly.
Essentially we are trying to adhere to cleaner development standards that mean BizTalk solution artefacts are nested within their own relevant folders, but some of the automated functionality of the VS SDK for BizTalk is making this seemingly impossible.
Is it possible to create a Property Schema in a specific directory within your solution root?
I don't seem to be able to enter a full filepath into the 'Default Property Schema' option on the source schema properties, as it errors with an 'illegal characters' warning for spaces and backslashes in the filepaths string.
I've tried using HTML encoding, escape characters and encapsulating it as a string, but they just return the same error each time.
I've also tried generating the schema in the root source, and then moving it manually into my target folder, changing the namespace accordingly to reflect its new location, but this loses it's connection within the source property schema and causes the link to break.

Yes, it is possible
After you have done your quick promotion, go into the Promote Properties and remove the Promoted Properties (1) and then the schema (2)
After that move and change the namespace of the Promoted Properties schema.
And then browse for the property schema (1) in the Promote Properties dialog and then select the item to promoted (2), click Add (3) and if you have more than one promoted property assign it to the correct one (4).

Related

Visual Studio: Assembly name and Default namespace from project name

Context: setting up the Assembly Name/Default namespace in the Project Properties (right click on project, Properties, Application tab; or edit the .csproj).
I would like to add a parameter there to explicitly have them following the Project Name, plus some custom suffix. So if I rename my project, the Assembly name/namespace follow that rename.
Example: project named foo → foo_suffix.dll. If I rename the project to foo1 → foo1_suffix.dll.
Same behaviour for the namespace.
Reading Common macros for MSBuild commands and properties,
I tried inputting $(ProjectName) both in VS and in the .csproj file, but I get a .dll named exactly like that.
How can I get this done?
How can I get this done?
1. Try using $(MSBuildProjectName) property from this document.
You're developing a C# project(csproj) while your document above is about macros in C++ projects(vcxproj). So I think $(MSBuildProjectName) property can be more suitable for you after my several tests.
(I tried $(ProjectName), but it only worked well when I set something like <AssemblyName>$(ProjectName)</AssemblyName>, if I add a suffix like $(ProjectName)_suffix, the output sometimes is _suffix.dll. But it always work well if I use $(MSBuildProjectName)!)
I get the desired behaviour, but that is inconsistent with what I can
see in project, Properties, Application tab.
2. Try reloading the project file(Right-click project, unload.., reload...) to Update the UI.
From your comment, it seems like the $(ProjectName)_suffix works well in your machine? If so, you can still use $(ProjectName) property.
What you experienced is expected behavior for Msbuild and VS. VS will read value from csproj during project loading process. Then it display the related value by UI.
So after we rename the project name and then build the project, we can get a ProjectName_suffix.dll in output folder. But the UI is still not changed(inconsistent), cause now we need to Update the UI.
You can right-click project node, unload the project=>reload the project to get UI updated. And now the output xx.dll can be consistent with what you see in project, Properties, Application tab. It needs us to reload the project each time after you rename the project, then the UI would be consistent with your xx.dll. And actually it won't affect your build though the UI is not updated, the output can be your desired behaviour.
3. All above is more related to the relationship between Assembly Name and Project Name. One point you should know is msbuild(csproj) won't modify the source files(xx.cs) after the project is created.
So assuming you have a Class1.cs file whose namespace is Library. If you rename the project to NewLibrary, reload the project and you can see the Namespace is NewLibrary now in project, Properties, Application tab. But the namespace for Class1.cs file is still old Library. This is expected behavior in VS, and the new NameSpace NewLibrary would work if you create a new xx.cs file.
Hope all above helps :)

Which is the most advantageous strategy for creating a tweaked Visual Studio Project Template?

I'm appealing to the wisdom of the crowd here, trying, in this case, to avoid the code less traveled.
I created a Visual Studio project template, but now find there are a couple of things I can/should add to it, and one or two things I need to modify.
What is the "received" way, or "preferred method" of doing this: modifying the existing template directly, or opening a project using the existing template, and then saving that template-based project, after modification, as a template, perhaps overwriting the previous one (if that's even possible/allowed by the VS "ecosystem")?
I copied the extracted contents of the zipped template from C:\Users\clayshan\Documents\Visual Studio 2010\Templates\ProjectTemplates\Visual C#\folder_name\template_name.zip to another location.
Does it make the most sense to open that project, modify, and save as a template, or to simply create a new project from the existing template, and then save that "new and improved" project as a template?
RUNNING COMMENTARY
When I open the extracted template as a project, I get a warning, "Load of property 'RootNamespace' failed. The string for the root namespace must be a valid identifier." I don't know if this is to be expected in this scenario, or if I should be slightly scared.
Another funky (as in "gives me the fantods", not as in the Troglodyte song) thing is that a template won't compile, as it's got those placeholder namespace names.
I edited the existing, zipped, copied it over to the village where the VS templates live and...now when I go to start a new project, there are two identical-looking templates there: the old, and the new. The question is, which is which? It's kind of annoying having to open them to see...
The final (hopefully) weird thing about the process is that, even though I added a "Site ULR" property to the template, on creating a new project from the template, that assignment reverts to blank.

TFS 2010 Global Field Editor

Working with TFS 2010 Power Tools, and able to edit template Fields via Process Editor.
However the Fields tab in the editor does not show "all" fields in that Project Collection.
For example if you create a field CompanyName.FooField in Team-Project-A, you will not see it when opening the Process Editor for Team-Project-B within the same collection.
Yet, you are not allowed to create a new field with the same Name or RefName. TFS insists on Name & RefName to be unique in the Project Collection.
You are allowed to create a New field in Team-Project-B using the same Name & RefName for FooField - I'm assuming field is somehow re-used across 2 Team-Projects.
After doing some research, TFS allows for fields to be re-used as long as they are within the same Project Collection (can be in dif. team projects).
Work Item Field Explorer (Tools/ProcessEditor) shows a READ-ONLY view of all fields.
Its obvious that TFS maintains a "Global" Field definition on the Project Collection Level, yet there seem to be additional association with individual Team Project.
It would be extremely helpful if there was a similar way to EDIT all fields at once within a Project Collection as opposed to bouncing between Process Editor windows for each Team Project.
Is there anyway to do that or has anyone faced a similar problem?
It is impossible because two collection projects are necessarily created on two different data bases, so the difficulty of achieving what you want, but betweentwo projects it is possible because they are on the same database instance.
link : http://msdn.microsoft.com/en-us/library/vstudio/dd236915.aspx

L2S DBML Table Stuck as "Internal" Visual Studio

I have a Linq to SQL data context with several tables. One particular table is marked in the DBML designer as having Public access, however when I save and compile the assembly it always changes the access modifier in the .designer file to internal. Thus the build always fails (as I have classes in other assemblies that reference this table) and I have to go into the .designer file and change the internal modifier back to public. Any change to the DBML file at all causes this to happen, even if I specifically set the property in the designer (toggle it back and forth, whatever). Is this a bug in VS (problem experienced in VS2010 and VS2013) and is there a fix?
Thanks.
I believe I have finally found a solution:
Open the .dbml file outside Visual Studio (e.g. Notepad)
Locate the problematic table definition.
Change AccessModifier="Internal" to AccessModifier="Public"
Save and close the .dbml file
Update the table definitions in the .designer.cs file with the public modifier if you have not already done so.
In theory the dbml designer should be doing this for me when I change that property on the table but unfortunately it doesn't for these particular tables. Following these steps fixed the problem.

How to associate a Resx file to a class in Visual Studio 2010

How do I associate/"bind" an resx file to a class file in Visual Studio?
For example, when a new windows form is created, an resx file is automatically associated with it.
I am asking this as the following code doesn't open the right resource file for another .cs file I have:
ComponentResourceManager manager = new ComponentResourceManager(typeof(MyClass));
This code works fine for frmLogin from above however.
The MSDN documentation for the constructor:
Creates a ComponentResourceManager
that looks up resources in satellite
assemblies based on information from
the specified Type.
That a form has an associated .resx file is an implementation detail that's specific to forms. You cannot otherwise associate an arbitrary class with a .resx file. I assume that you actually want to use a ResourceManager here.
Do note that there's one already built-in through Properties.Resources, giving you access to resources that you added to Project + Properties, Resources tab.
Should you have lost this indenting by adding existing files to a project, you can restore the indenting for files, though I have not tried it for all file types, by using the 'DependentUpon' node in the project file.
The technique is described in more detail at Code rant: Nested files with 'DependentUpon' in Visual Studio
I found an existing answer on SO since discovering the article above, but as the question is formulated so differently I'm keeping this answer in place.

Resources