如何防止Visual Studio创建license.licx [英] How can I prevent Visual Studio from creating license.licx

查看:381
本文介绍了如何防止Visual Studio创建license.licx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在项目中使用了第三方控制.几乎每当我双击同样具有设计视图的文件时,Visual Studio都会尝试大力培养设计者,并且在无响应之后,它会向我们的解决方案中传递(产生)一个license.licx文件.这不必要地打乱了源代码控制:文件添加也修改了csproj,原始代码文件加上designer.cs也被检出(尽管它们没有任何修改).

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. 我只想查看代码(单击鼠标右键,查看代码),我不想看设计者视图.
  2. 每次我都需要撤消不必要的更改,这会花费一些时间(我们的解决方案非常耗时),而Visual Studio再次没有响应,因为自从csproj更改以来,它重新加载了整个shebang.
  3. 当我双击鼠标时,我立即意识到我做了什么,但是那时已经太晚了,发条开始磨碎了.

如果有人知道如何禁用该licx的添加,请告诉我.仅供参考:相关的第三方库是DevExpress WinForms和IdeaBlade DevForce Classic(与DevExpress集成在一起).我使用VS 2012. 我们的产品是最终用户产品,而不是第三方库.

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.

说明:我们正在谈论开发环境.请参阅如何基于Licenses.licx的.Net组件许可模型有效吗?-不建议将其保留在源代码控制中.我不想为此辩论.让我们集中讨论如何阻止Visual Studio一直尝试创建它.

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.

推荐答案

您可以创建一个构建后事件,该事件将为您删除.licx文件.我们已经解决了团队中的这种烦恼,除了手动排除或删除它之外,后期构建事件是您最好的选择.每次打开Windows窗体时,如果该窗体正在引用或使用任何第三方.dll,则将再次添加该文件.

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.

这篇关于如何防止Visual Studio创建license.licx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆