Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Why are template files being transformed during project creation?

$
0
0

Hi all,

I have a couple of project templates that contain a number of c# files that are supposed to be copied during project creation so that the user has a starting point for the new project. These are wrapped up with a package in a VSIX. Projects of my type can be created without a problem (over the last few releases of VS). However, VS2013 seems to be 'massaging' the files so that the formatting is messed up by the time the user opens the resulting file. Here's an example, this is what is in the VSIX:

namespace PSNApplication

{

    public partial class PageMain : Page

    {

        public PageMain()

        {

            InitializeComponent();

        }

    }

 }

And the resulting file is as follows:

namespace PSNApplication {

    public partial class PageMain:Page {

        public PageMain() {

        InitializeComponent();

        }

    }

}

Note what has happened:

    1. Each opening curly brace has been moved and is now preceded by a single space.

    2. The spaces on each side of the colon have been removed.

    3. Part of the indent (my original file included tab characters) of the constructor body has been removed.

The file is changed, even before I open it for the first time in the project (I have checked this in notepad). So I don't suspect the text editor has applied its formatting options due to opening the file. But something has changed the layout during project creation.

Does anyone know why this is happening? Should I implement some interface to have more control over this? I really want an exact copy of the original file to be available after the project has been created!! It used to work before VS2013, I believe!

Thanks for any help, Loz.


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>