We manage the structure of our database using a SQL Server Data Tools project (.sqlproj), creating new objects in Visual Studio and publishing them to the SQL Server instances (directly or by generating a publish script).
SSDT automatically names FKs using the format
FK_ThisTable_ThatTable
We use SqlMetal to generate a Linq-to-SQL DBML.
<Table Name="dbo.Foo" Member="Foos">
<Type Name="Foo">
<Column Name="FooID" Type="System.Int32" DbType="Int NOT NULL IDENTITY" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
<Column Name="Value" Type="System.String" DbType="VarChar(50)" CanBeNull="true" />
<Column Name="BarID" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
<Association Name="FK_Foo_Bar" Member="Bar" ThisKey="BarID" OtherKey="BarID" Type="Bar" IsForeignKey="true" DeleteOnNull="true" />
</Type>
</Table>
If I open the DBML in VisualStudio's designer, modify the diagram layout and save, the DBML now contains
<Association Name="Bar_Foo" Member="Bar" ThisKey="BarID" OtherKey="BarID" Type="Bar" IsForeignKey="true" DeleteOnNull="true" />
This means the history of our DBML file in TFS source control is a lot harder to read due to the unnecessary changes made by MSLinqToSQLGenerator and the restoration of the original names after running SqlMetal.
How do I stop Visual Studio's DBML Designer from modifying the FK names?
Related
I'm using Visual Studio 2017. I used the asset generator to auto-generate icons for my app, but most of them look very bad. So, I thought to cut down on the number of icons, but now I can't find any option to remove an image from the Visual Assets listing. only adding/auto-generating them. Opening the associated Package.appxmanifest file doesn't show any of these images being even referenced. And without solving this problem, Visual Studio is not letting me even build the project >_<
So, I'd like to understand how to remove some of these images? Searching the microsoft forums, but haven't yet found anything related to "removing" assets,
Just delete the path to the file, ie Assets\SmallTile.png in Package.appxmanifest.
You cannot however remove all the assets since some sizes like splash screen or medium tile are required - you'll have to generate/add new.
Also make sure that these checkboxes are not checked for icons you've removed.
You need to undo in 3 steps:
Remove the Logo settings from Package.appxmanifest, but leave the required ones.
Open Assets folder, delete all auto-generated assets, again, leave the required ones.
Close your project, and open your .csproj file in notepad, delete the newly added referenced items - they look like below, and then save the csproj file.
<ItemGroup>
<Content Include="Assets\LargeTile.scale-100.png" />
<Content Include="Assets\LargeTile.scale-125.png" />
<Content Include="Assets\LargeTile.scale-150.png" />
<Content Include="Assets\LargeTile.scale-200.png" />
<Content Include="Assets\LargeTile.scale-400.png" />
<Content Include="Assets\SmallTile.scale-100.png" />
<Content Include="Assets\SmallTile.scale-125.png" />
<Content Include="Assets\SmallTile.scale-150.png" />
...
I have a property sheet in Visual Studio 2010 that imports some other property sheets. My property sheet's imports section looks like this:
<ImportGroup Label="PropertySheets">
<Import Project="something.props" />
<Import Project="something.else.props" />
</ImportGroup>
I want to make sure that the person who adds my property sheet, which imports something and something.else can't accidentally change the import order of my included sheets. For example this would be wrong:
<Import Project="something.else.props" />
<Import Project="something.props" />
I checked Microsoft's website but I can't find a way to prevent the order from being changed. In Visual Studio intellisense shows Condition and Label for <ImportGroup> and Condition, Label and Project for <Import>. Aside from setting the file read only (which won't last since I have to check it into source control) is there anything I can do inside my property sheet to prevent the order from being changed?
Thanks
It's just wonderful that Label attribute for ImportGroup isn't defined in xml schema http://msdn.microsoft.com/en-us/library/5dy88c2e(v=vs.100).aspx. Sigh...
About question - I doubt you can make 100% buletproof solution due to msbuild nature of properties priority, but simple moving your own import to the bottom of msbuild file will guarantee some kind "protection" for your values.
i'm developing a Visual Studio 2010 extension, i already have a toolbar inside my window. on that toolbar i have a button that i want to give an icon - my own icon!
I've read this article and it is great but... it explains how to replace the icons.
i want to add an additional icon.
how do i achieve that?
First, add the bitmap and set its build action to Resource
Remember, shocking pink = transparent (damn you, old school!)
Then, in your vsct file, add the image to the bitmaps section
<Bitmaps>
<Bitmap guid="AddSampleData.bmpGuid"
href="..\Button Bitmaps\AddSampleData.bmp"
usedList="AddSampleData.bmpId" />
<Bitmap guid="ApplySampleData.bmpGuid"
href="..\Button Bitmaps\ApplySampleData.bmp"
usedList="ApplySampleData.bmpId" />
</Bitmaps>
and assign it a guid in the symbols node
<Symbols>
<!-- snip -->
<GuidSymbol name="AddSampleData.bmpGuid"
value="{dcae7c84-8e91-4f8a-907b-95ccb0f52e6e}">
<IDSymbol name="AddSampleData.bmpId"
value="1" />
</GuidSymbol>
<GuidSymbol name="ApplySampleData.bmpGuid"
value="{9f555245-2430-4e6f-992b-b49ce87a31a2}">
<IDSymbol name="ApplySampleData.bmpId"
value="1" />
</GuidSymbol>
</Symbols>
and apply it to a button
<Buttons>
<!-- snip -->
<Button guid="guidEditorExtensionCommandSet"
id="setDesignTimeDataOnPage"
priority="0x0100">
<Icon guid="ApplySampleData.bmpGuid"
id="ApplySampleData.bmpId" />
<Strings>
<!-- snip -->
</Strings>
</Button>
</Buttons>
Of course, its always easier to use the available tools, including the excellent VSPackage Builder extension.
A workaround for this is to create a PNG and rename the extension as *.bmp. VS will accept it as an icon image and it will also have transparency (from Visual Studio Extensibility > Toolbox Icons -- Is transparency supported?)
I created an app.config transform for my WinForms project using Dan Abramov's solution here. Works great and the config file is transformed and present in the correct obj folder.
When I look at the outputs for the Primary Output of my application, it gets the app.config from the project directory instead of the corresponding obj folder like everything else...a big oversight, in my opinion, by MSFT. Obviously, they didn't have transforms in mind for all config file types.
So now, how do I get the Primary Output of my main project to output the config file from the obj folder based on the build configuration?
Have you tried using SlowCheetah (a VS extension) which enables you to transform app.config in the same way that web.config works. Also your scenario for transforming app.config for a setup project is supported.
I found the work around I was looking for here. Scroll to the bottom and see kakoskin's answer. In conjunction with Dan Abramov's solution, I was able to get the results I was looking for. Here's the MSBuild code I used:
<Target Name="AfterBuild" Condition="exists('app.$(Configuration).config')">
<TransformXml Source="app.config" Destination="$(IntermediateOutputPath)$(TargetFileName).config" Transform="app.$(Configuration).config" />
<!-- Force build process to use the transformed configuration file from now on. -->
<ItemGroup>
<AppConfigWithTargetPath Remove="app.config" />
<AppConfigWithTargetPath Include="$(IntermediateOutputPath)$(TargetFileName).config">
<TargetPath>$(TargetFileName).config</TargetPath>
</AppConfigWithTargetPath>
</ItemGroup>
<TransformXml Source="App.config" Transform="app.$(Configuration).config" Destination="App.Transformed.config" />
The <ItemGroup> section will remove the app.config file from the corresponding obj\ folder and replace it with the transformed config file, which is not needed but I left it in there anyways.
Hope this helps others out as well!
I created a new team project with the Visual Studio Scrum 1.0 template. I'm trying to migrate my work items from the MSF Agile Template 5.0 to that one using the TFS Integration Tools/Platform.
I created the Work Item Type Mappings in the xml:
Bug > Bug
Issue > Impediment
User Story > Product Backlog Item
Task > Task
I get many conflicts...but the relevant ones to this question are:
Details: Work Item Type 'Issue' is not mapped in the configuration
Details: Work Item Type' User Story' is not mapped in the configuration
I created the configuration using the WorkItemTracking.xml template.
I'm using the following xml
<SettingXml>
<WITSessionCustomSetting>
<Settings />
<WorkItemTypes>
<WorkItemType LeftWorkItemTypeName="Bug" RightWorkItemTypeName="Bug" fieldMap="##ALL##" />
<WorkItemType LeftWorkItemTypeName="Task" RightWorkItemTypeName="Task" fieldMap="##ALL##" />
<WorkItemType LeftWorkItemTypeName="User Story" RightWorkItemTypeName="Product Backlog Item" fieldMap="##ALL##" />
<WorkItemType LeftWorkItemTypeName="Issue" RightWorkItemTypeName="Impediment" fieldMap="##ALL##" />
</WorkItemTypes>
<FieldMaps>
</FieldMaps>
<ValueMaps />
</WITSessionCustomSetting>
</SettingXml>
I've added rules to ignore the Target Field Does Not Exist conflicts.
Any idea what's going on here?
Looks like implicit mapping in TFS Integration Platform is really buggy. Added explicit field mappings and it worked.
Is it possible that your "left" and your "right" are switched?
Thanks,
Erin