How to change icon of file based on file type in Visual Studio Extension - visual-studio

ITNOA
I have a GitHub project for Visual Studio Ansible extension, in this extension I want to change icon of ansible file in Visual Studio (.ansible and .ansible.yaml) based on file extension, but I do not know How to do it?
Anybody know to How to do it?
I write extension for Visual Studio 2022
related to https://github.com/MicrosoftDocs/visualstudio-docs/issues/8966#issue-1588941743
Updated 2/17/2023
I think it is related to https://learn.microsoft.com/en-us/visualstudio/extensibility/internals/manifest-from-resources?view=vs-2022
and based on How to add custom icons to solution explorer in Visual Studio I try to add resources and image manifest, but my file display void instead of display correct icon, and I do not know my mistake
I update source code, that you have see it https://github.com/soroshsabz/visualstudio-ansible/tree/features/5-add-syntax
related to https://developercommunity.visualstudio.com/t/New-icon-for-custom-file-type-is-not-d/10283644
thanks

Related

Cant save BIML file in Visual Studio

I have just started trying to use BIML to generate my SSIS packages. Im currently using VIsual studio 2015 to do everything.
When I add a new BIML file to the project it appears in the Solution explore and I can open the file and edit it. But when I save and close and reopen none of the changes where saved. Is there a setting that i need to change in Visual Studio? Currently I have to edit this file through the use of Notepad++ or something similar.
Visual Studio ScreenShot
As a work around to this issue, you could right click on the file you wish to edit and choose XML (Text) Editor.
Sadly you'll loose intellisence for the C# code
If you open a file twice, once in the BIML editor and once in the XML editor then you can view side by side making your changes in XML but viewing nice formatting in BIML...

VisualStudio 2017 - can't add resx file

I'm trying to setup localization in my xamarin.form application following this tutorial : https://developer.xamarin.com/guides/xamarin-forms/advanced/localization/ .
But when I go to the menu 'add new item' in vs 2017 I can't find a option to create a resource file. Why is that? what is the solution?
By writing the word resx in the search box you will not be able to find the template for resource files. You must click on the General tab and locate in the resource files option.
If this does not work you should repair Visual Studio from the Visual Studio installer.
In my case i had to modified my installation and check .NET desktop development
That solved my problem
Apparently this was resolved in VS2017
https://developercommunity.visualstudio.com/content/problem/85616/add-new-item-resource-file-resx-missing.html
but I had to use the same fix to get it working in VS2019

Why Visual Studio 2013 propose saving file in saving file dialog?

Sometimes when I've change some file and type Ctrl+S, Visual Studio 2013 Professional doesn't save it in normal way but propose me Save this file as... in Save File Dialog and then in folder with my file appears another file like xjxklb2q.10h or brq1p3lm.0gi. Anybody knows what is going on?
I'd log a bug to Visual Studio. If you look in the top right corner there's a smiley face that allows you to "send a frown" - just describe what you were doing and it will be picked up by someone in the platform team.

How to enable open XML Package Editor power tool for Visual Studio

I want to create customized ribbon on my excel sheet. I saw some of the tutorial (e.g, http://www.youtube.com/watch?v=hn3Qkp4Jw34) where they used Open XML package editor power tool for visual studio 2010 and worked on some xml configuration file to add ribbon. Hence I downloaded the tool and installed it. But when I drag and drop the excel file to the VS-2010, the file instead of opening in the VS editor it is opening in its new excel window. I tried to do same thing for a word file but still it is opening in new word window instead of opening in VS editor. Anybody could you please help me regarding this. I was using Visual Studio 2012 but then I came to know that Open XML package editor power tool for visual studio 2010 won't work for VS-2012 hence Installed VS-2010 but still getting same problem.
Thank you
Anup, Have you tried going to File->Open from Visual Studio?
If that opens it from an Office client application as well, then the Visual Studio Package Editor is not the default option for opening documents of that file extension.
If the document is a part of a solution (you can just create a new blank solution and add it in) you can right click on the file from Solution Explorer and choose "Open With", from there you can choose to open that file as a "Package File", and you can also select this as the default way to "open" files of that extension in Visual Studio.
I work for Microsoft and have just updated this plugin to work with VS2012 and 2013. Drag and drop should work in all the VS versions (I just tested it) but perhaps it's worth trying downloading the updated extension from the Gallery and seeing if it works for you in the newer VS version.

Xamarin.Android Intellisense not working in Visual Studio 2010

I'm testing out Xamarin.Android in Visual Studio 2010 and have noticed that I have no Android Intellisense when I'm working in an Android Layout (.axml) file. However, I do get Android Intellisense when I'm working in a .cs file.
Example:
Here is a screenshot of my Main.axml file that lives in my Layout directory. Notice how the intellisense doesn't contain anything within the Android namespace.
What do I need to do to get intellisense to display the Android namespace in a .axml file?
Kannan Balasubramanian has posted an answer that worked for me (Binary Bits)
Here's Kannan's solution:
Most of the people who work with Xamarin’s Mono for Android in Visual Studio 2012 face a bug where Intellisense doesn’t work for AXML in source view.
One of the fix which worked for me is mentioned below.
Launch Visual Studio 2012
Open a solution with .AXML file in it
Now XML main menu should be visible on top
Open “Schemas…” menu
Sort by “File Name” column and see if “android-layout-xml” and schemas.android.com.apk.res.android” are there. If found, skip to step 13
If not found, go to “Program Files” if 32-bit system or “Program Files (x86)” if 64-bit system.
Then go to “\MSBuild\Novell” or “\MSBuild\Xamarin\Android”
You should be able to see 2 files “android-layout-xml.xsd” and “schemas.android.com.apk.res.android.xsd”
Copy these 2 files to “\Microsoft Visual Studio 11.0\Xml\Schemas”
Again open the “Schemas…” menu as mentioned in steps 3&4
Now click “Add…” button and add these 2 files which should be located as mentioned in step 7 & 8
Now restart visual studio and the XML editor for design layout should work fine with Intellisense
From step 5….
If above steps don’t work, then close the Visual Studio 2012.
Now open “Developer command prompt for VS2012″ under Windows programs menu.
Type “Devenv /ResetSettings” without quotes.
Launch Visual Studio 2012 and see if Intellisense works.
If still not working, better go to Xamarin forums and post there.
I just installed the latest release Xamarin.Android 6.0.1 – this may have been resolved in this release

Resources