Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I prevent Visual Studio from creating license.licx

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 starts 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.

like image 282
Csaba Toth Avatar asked Aug 05 '13 21:08

Csaba Toth


People also ask

What is LICX license?

The licenses. licx file is a text file located in a . NET project that notifies Visual Studio to compile a license file into an executable's resource. This enables EXE applications to be deployed to a machine without an SDK installed.


1 Answers

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.

like image 169
captray Avatar answered Sep 22 '22 14:09

captray