How can I prevent Visual Studio from creating license.licx

For your point #1, you could prevent double-clicking from opening the designer but instead open the code editor by default.

You can do this by:

  • right-clicking on a .cs file that has a form
  • select "Open with..."
  • select "CSharp Editor" (or VB)
  • click "Set as Default"
  • and OK

If you want to change it back later, follow same procedure but pick "CSharp Form Editor".


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.


If anyone is looking for solution for this problem because they are using precompiled licenses via Lc.exe tool and want to prevent licenses.licx from conflicting on build server, edit your csproj file, and change line that looks like this:

<EmbeddedResource Include="Properties\licenses.licx" />

into this:

<ItemGroup Condition=" '$(Configuration)' != 'Release' " > <EmbeddedResource Include="Properties\licenses.licx" /> </ItemGroup>