Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export Visual Studio Template error: "Unable to read an exported file"

When exporting a Visual Studio project to a Template (File/Export Template...) I get the following error upon clicking the Finish button:

    Unable to read an exported file for the following
    reason: The file cannot be opened with the selected 
    editor. Please choose another editor.

Screenshot http://img687.yfrog.com/img687/1756/templateerror.png

A Google search for this error has only led to several dead ends. There aren't any unusual file types in this project. Any ideas what could be going on?

like image 269
Herb Caudill Avatar asked Jan 23 '26 04:01

Herb Caudill


2 Answers

By laborious trial and error (start with an empty project, add a folder, try to export template) I was able to narrow this down to a single Javascript file. As it happens, it's one of the language definitions for prettify.js (which is used on this site for code coloring). The file in question is lang-hs.js, and for some reason Windows on my machine treats this file differently from other Javascript files: It opens in Notepad, when I have the .js extension mapped to Visual Studio.

I'm not sure what the underlying explanation is, but I've already wasted enough time on this and I believe I can live without Haskell code coloring (!) so I'm just deleting this file and moving on.

like image 166
Herb Caudill Avatar answered Jan 25 '26 21:01

Herb Caudill


It seems ".cur" files are often a culprit in this error. I have removed them from my project and now the exportation works correctly.

Microsoft staff suggest looking at log files (../windows/system32/compmgmt.msc) but this error does not spawn an entry into the Application EventLog.

like image 41
math_dsl Avatar answered Jan 25 '26 21:01

math_dsl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!