开发者

Quick way to assign default build action and editor for a file type VS2010

I need a way to quickly set the build action of files with extension .jsx to 'Content' and to associate the VS2010 default script editor to them - I need to roll this environment change out to all the mem开发者_如何学运维bers of my development team.

I've used this online tool to generate a .pkgdef with the default build action - but I can't find a simple way to setup the editor association (without using VS' own UI).


Update This does also work for Visual Studio 2012 (after restarting a few times it would seem), however you need to take the editors bits off the bottom, as I don't know what the editor Guids are in VS2012 and have simply used the UI to do the association.

With the correct Google-fu I found this other SO:

Open a file in Visual Studio's CSS Source Editor

So here's my complete pkgdef (also including another file type .cssx associated with the .css editor):

; .jsx files in Windows (C#) projects
[$RootKey$\Projects\{fae04ec0-301f-11d3-bf4b-00c04f79efbc}\FileExtensions\.jsx]
"DefaultBuildAction"="Content"

; .jsx files in Windows (VB.NET) projects
[$RootKey$\Projects\{f184b08f-c81c-45f6-a57f-5abd9991f28f}\FileExtensions\.jsx]
"DefaultBuildAction"="Content"

; .jsx files in Web Application projects
[$RootKey$\Projects\{349c5851-65df-11da-9384-00065b846f21}\FileExtensions\.jsx]
"DefaultBuildAction"="Content"

; .jsx files in Web Site projects
[$RootKey$\Projects\{e24c65dc-7377-472b-9aba-bc803b73c61a}\FileExtensions\.jsx]
"DefaultBuildAction"="Content"

; .cssx files in Windows (C#) projects
[$RootKey$\Projects\{fae04ec0-301f-11d3-bf4b-00c04f79efbc}\FileExtensions\.cssx]
"DefaultBuildAction"="Content"

; .cssx files in Windows (VB.NET) projects
[$RootKey$\Projects\{f184b08f-c81c-45f6-a57f-5abd9991f28f}\FileExtensions\.cssx]
"DefaultBuildAction"="Content"

; .cssx files in Web Application projects
[$RootKey$\Projects\{349c5851-65df-11da-9384-00065b846f21}\FileExtensions\.cssx]
"DefaultBuildAction"="Content"

; .cssx files in Web Site projects
[$RootKey$\Projects\{e24c65dc-7377-472b-9aba-bc803b73c61a}\FileExtensions\.cssx]
"DefaultBuildAction"="Content"

; JSX editor
[$RootKey$\Languages\File Extensions\.jsx] 
@="{705DBF52-7DC2-4258-8CA3-49FFFEF81866}" 

[$RootKey$\Editors\{A52A054C-5228-4819-B568-E5B8040801B5}\Extensions]
"jsx"=dword:00000028

; CSSX editor
[$RootKey$\Languages\File Extensions\.cssx] 
@="{A764E898-518D-11d2-9A89-00C04F79EFC3}" 

[$RootKey$\Editors\{A764E89A-518D-11d2-9A89-00C04F79EFC3}\Extensions]
"cssx"=dword:00000028
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜