How can I prevent Visual Studio from creating license.licx

Csaba Toth picture Csaba Toth · Aug 5, 2013 · Viewed 7.7k times · Source

We use 3rd party controls in our project. Almost every time when I double click on a file which has a design view too, Visual Studio tries to bring up the designer with heroic effort, and after some unresponsiveness it delivers (gives birth to) a license.licx file into our solution. That unnecessarily disturbs the source control: the file addition modifies the csproj too, and also the original code file plus the designer.cs gets checked out (although they don't have any modification in them).

  1. I only want to see code (right click, View Code), I don't want to see the designer view.
  2. Each time I need to undo the unnecessary changes and that takes time (our solution is gargantuous), while Visual Studio is unresponsive again, since it reloads the whole shebang since the csproj changed.
  3. When I double click, I immediately realize what I did, but it's already too late at that time, the clockwork start to grind.

If anyone knows how to disable the addition of that licx, please let me know. FYI: relevant third party libraries are DevExpress WinForms and IdeaBlade DevForce Classic (which has some integration with DevExpress). I use VS 2012. And our product is an end-user product, and not a third party library.

Clarification: we are talking about a development environment. See How does the Licenses.licx based .Net component licensing model work? -- it's not advised to keep it in source control. I don't want to debate about that. Let's focus on how to prevent Visual Studio to try to create it all the time.

Answer

captray picture captray · Aug 6, 2013

You can create a post build event that removes the .licx file for you. We've dealt with this annoyance on our team, and aside from manually excluding or deleting it, the post build event is your best bet. Every time you open a Windows Form, the file will be added again if that form is referencing or using any of the 3rd party .dlls.

You can specify the pre and post build events via console or by right clicking on the project and selecting Properties -> Build Events. Hope this helps.