WPF 4 嵌入字体导致 VS2010 构建缓慢
将 VS2008 项目升级到 VS2010 后,我们发现 VS 需要 60 秒才能真正开始构建我们的项目。
使用 VS 2008,我们的项目将在 3 秒内构建。
我终于发现,当我们使用 Expression Blend 3/4 将字体嵌入到我们的项目中时,它会减慢 VS 2010 中的构建速度。
有没有人有解决方案来解决这个问题?
我们需要在 WPF 应用程序中嵌入 20 种字体,而我无法在每次构建应用程序时等待 60 秒。现在,如果我从项目中排除 Fonts 文件夹,它会在 3 秒内再次构建......
After upgrading our VS2008 Project to VS2010 we found that VS would take 60 seconds before it appeared to actually begin building our project.
With VS 2008 our Project would build in 3 seconds.
I finally discovered that when we use Expression Blend 3/4 to embed a font into our Project, it slows down the build in VS 2010.
Has anyone got a solution to fix this?
We need 20 fonts embedded in our WPF application, and I CANNOT HANDLE waiting 60 seconds everytime I build my application. For now if I exclude the Fonts folder from the Project it again builds in 3 seconds...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将字体作为单独的资源 DLL 的一部分,仅在更改字体时才编译该资源 DLL。这样,您只需将 DLL 文件包含到项目中,每当更改字体时,您都可以使用部署批处理文件将 dll 复制到项目中,因为它将需要实际文件才能运行。这样,您就不必每次都重建字体,还可以节省每次构建时重建字体所需的时间。
这种方法还可以避免您将其关闭,并帮助您将资源与实际应用程序分开。
You can put the Fonts as part of a separate resources DLL that you only compile when you make changes to the fonts. This way, you just include the DLL file to your project, and whenever you change the fonts, you use a deployment batch file to copy the dlls to the project, since it will need the actual files to run. This way, you don't rebuild fonts every time, you will also save the time it takes to rebuild them every time you build.
This approach also avoids you turning it off, and helps you separate the resources from the actual application.