.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

Is embedding of fonts in wpf application will save from corrupted font cache?

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :WPF
 

Hi

Recently I had corrupted font cache. I fixed it by removal of cache file and restarting of Wpf font cache service. Also I updated my outdated driver.

However there're lot's of users on customer side without administrative rights and there're no way to upgrade their pretty old drivers of videocards.

 

Could you say me what if i embed all fonts application use in application resources - will it help those guys to not relay on Font Cache ?




View Complete Post


More Related Resource Links

"System.ArgumentException: Font '?' cannot be found" during application start up. Any ideas?

  
We have couple of users that get this error when they run our application.  I have never seen this problem before. Client says fonts are installed and Microsoft Sans Serif font is there as well. Also he states that user has Read permissions to %SytemRoot%Fonts folder. Any suggestions or ideas how to fix this problem will be appreciated. Thank you.  Here is the stack:   Exception: System.ArgumentException: Font '?' cannot be found.   at System.Drawing.FontFamily.GetGdipGenericSansSerif()    at System.Drawing.FontFamily.get_GenericSansSerif()    at System.Drawing.SystemFonts.get_DefaultFont()    at System.Windows.Forms.Control.get_DefaultFont()    at System.Windows.Forms.Control.get_Font()    at System.Windows.Forms.Control.AssignParent(Control value)    at System.Windows.Forms.Control.ControlCollection.Add(Control value)    at Bloomberg.SmartClient.Hosting.ErrorControl.InitializeComponent() in C:\Projects\Source\Client\ApplicationHosting\ErrorControl.cs:line 218    at Bloomberg.SmartClient.Hosting.ErrorControl..ctor(String appTitle, Boolean inPanel, Exception exception) in C:\Projects\Source\Client\ApplicationHosting\ErrorControl.cs:line 119    at Bloomberg.SmartClient.Hosting.ApplicationHost.OnDisplayError(ApplicationDescription appDescription, Excepti

"System.ArgumentException: Font '?' cannot be found" during application start up. Any ideas?

  
We have couple of users that get this error when they run our application.  I have never seen this problem before. Client says fonts are installed and Microsoft Sans Serif font is there as well. Also he states that user has Read permissions to %SytemRoot%Fonts folder. Any suggestions or ideas how to fix this problem will be appreciated. Thank you.  Here is the stack: Exception: System.ArgumentException: Font '?' cannot be found.   at System.Drawing.FontFamily.GetGdipGenericSansSerif()    at System.Drawing.FontFamily.get_GenericSansSerif()    at System.Drawing.SystemFonts.get_DefaultFont()    at System.Windows.Forms.Control.get_DefaultFont()    at System.Windows.Forms.Control.get_Font()    at System.Windows.Forms.Control.AssignParent(Control value)    at System.Windows.Forms.Control.ControlCollection.Add(Control value)    at Bloomberg.SmartClient.Hosting.ErrorControl.InitializeComponent() in C:\Projects\Source\Client\ApplicationHosting\ErrorControl.cs:line 218    at Bloomberg.SmartClient.Hosting.ErrorControl..ctor(String appTitle, Boolean inPanel, Exception exception) in C:\Projects\Source\Client\ApplicationHosting\ErrorControl.cs:line 119    at Bloomberg.SmartClient.Hosting.ApplicationHost.OnDisplayError(ApplicationDescription appDescription, Exception err

Best practice: Where to save data from application pages?

  
Hello, I have a feature scoped at site level which contains some application pages, where I need to save some "settings data" from. I'm thinking I should use some hidden lists in the root of the site collection to save this data. For example one of the application pages registers timer jobs that should then use information entered in the application page. I'm wondering if this is, in your opinion, the right approach? Thanks.

Client Application Services - Role service cache time out bug

  
Hi All, For people using Client Application Services with WPF, be aware of this bug. You can configure the "cache time out" for roles to be fetched again from the service. (In the visual studio dialog, Properties -> Services -> Advanced) This means the roles are cached on the client (in a file). If the application asks for roles again, they are not fetched again for "cache time out" time. When you set this value, it goes into your App.config, transformed into seconds. So if you choose 1 minute, the App.config has: cacheTimeout="60".   However, when using the ClientRoleProvider (for instance to do something like clientRoleProvider.GetRolesForUser("SomeUser")), this cacheTimeOut is interpreted in Minutes, not seconds! To prove my point, check ClientRoleProvider.Initialize method:   string temp = config["cacheTimeout"]; if (!string.IsNullOrEmpty(temp)) _CacheTimeout = int.Parse(temp, CultureInfo.InvariantCulture);   Later on, in ClientRoleProvider.GetRolesFromDBUser (what's in a name?), you see: _CacheExpiryDate = cd.RolesCachedDateUtc.AddMinutes(_CacheTimeout);   Testing also shows this behavior. So be aware, and always put the value in minutes in your App.Config!   Regards, Koen

Cache settings on shared application pool

  
I have several web applications on a server using the same application pool. The worker process usually takes a lot of ram but usually only from one application. I can successfully limit the cache usage by setting "PrivateBytesLimit" in web.config file when the application uses it own dedicated application pool. Does anyone know how this setting will be applied when using shared application pool? Is it per application, per worker process or per application pool? Also if it is not per application which setting from which application will be applied?

Access HttpApplication cache from different application/domain

  
Hello all, How can I access the cache of one web application/domain from another web application/domain? Here is my scenario. I need to verify/check the existence of a certain object in one web application/domain's cache from another web application/domain. Any guidance on how to do this? Thanks.  - Randolph

What's the best way to store Data from DataBase like XmlNode... Application vs Cache

  

 Hello, i am building an N-tier application now i want to store Data(like XmlNode) that is common to all users ..

now i thought using Application to hold the data but my data lays in the BLL tier which is an Class Library project and i can't store any datain there for example :

HttpApplication MyApp=new HttpApplication();

MyApp.Application["Data"]=XmlNode;

 

My question is what is the best way to store Data (not small data like user name etc..) is it Application? orCache?

i would like a small example within a ClassLibrary project...

nirniron


save XML document became corrupted?

  

Hi all, I am experiencing a strange issue with my program: My program needs a simple data storage so I used a xml file. first, I read the data upon page opening, when user enters/modifies the form it saves the data back into the xml file.

Here is the pseudo code:

public partial class _Default : System.Web.UI.Page{
     public XmlDocument doc; //xml document
     protected void Page_Load(args)
    {
        doc = new XmlDocument();
        doc.Load(path);
        /*reading data from xml doc*/
     }
   protected void Button1_Click(args){   //When button clicks
        /*appends form data to xml doc*/
        
         doc.Save(path);
    }

}

The symptom: When I am running on my local machine it runs perfectly fine, However, when I run it on my web host,  the Save process seemed to terminate before the file is finished writing. The point it stops is completely arbitrary... here is an example of corrupted xml:

<root>
<a attr="attribute 1"></a>
<a attr="attribute 2"></a>
<a attr="attribute 3"></a>
<a attr="attribute 4"></a>
<a at    <--- file terminates here, randomly, no exception thrown.

Any ideas what might have caused the problem?





Application Hangs with the default font "Segoe UI"

  
Hello All,

I got a problem after installing VS2010, i have already reinstalled VS2010 but the problem persist and now it occurs on VS2008 too.

In my application (WPF and .NET 3.5 SP1) when i open one of the application screens. The application hangs and stopped to work. I discovered that this is because of a GroupBox that have in text Header a Fontsize=16, if i let the fontsize default the problem dont occurs, i use default font "Segoe UI".

I did some testing and discovered that if I simply create a new application in WPF and .NET 3.5 and add a button on the screen and increase the font size of button to size of 14, 16 or 18, when I give F5 the application will hang. In design mode its works, but when i run the application its presents the problem.

The font dont have any problem because i can use it normally on "Notepad" or "Word" and when i create a new application in WPF and .NET 4 its works perfectly, it just give problems in .NET 3.5. Anyway i already reinstalled the Segoe UI font too.

If i change the font to Segoe UI Symbol or any other and change the size to 14, 16, 18 its works normally, just with the default font Segoe UI and font

Session/Cache/Others in ASP.Net MVC application

  

Hi,

We are developing an application which has tabbed views for user input. We need to "cache" the data entered in one tab while the user is filling up other tab. Though "Form Caching" is not allowed.

Please let me know the following:

  1. What is the best way of temporarily storing data in ASP.Net MVC web application?
  2. Are sessions a good idea?
  3. Are OutputCache and ResultCache the forbidden "Form Cache"? 

Thanks,

Dipti


Application or Cache?

  

Hi,

I'm saving some tiny variables (such as a visitor counter)  to Application("myvariable"). It works fine on my testing machine.

Now I read that one should use Cache("myvariable") instead, as Application could be a bottleneck (I need to update the variable in a .ascx page, and someone said it should be done in the Global page).

Is ths correct, or can I live happily with my Application variables? I'd prefer not to change it, as I really want these variables to live as long as the application lives or until they are reset in code.

Thanks a lot for clarifying!

/Pettrer


Clearing application cache on a shared hoster

  

This code clears application cache on my local machine very well.


Dim keys As New ArrayList
            ' retrieve application Cache enumerator
            Dim enumerator As IDictionaryEnumerator = X.Cache.GetEnumerator()
            ' copy all keys that currently exist in Cache
            While enumerator.MoveNext()
                keys.Add(enumerator.Key.ToString())
            End While
            ' delete every key from cache
            For i As Integer = 0 To keys.Count - 1
                X.Cache.Remove(keys(i).ToString)
            Next
            keys.Clear()
            keys = Nothin

Save MVC Chat Room Data in Application variable or DB, where is better ?

  

My application is MVC Web App Chat Room , it supports following features:

1.Create/Join/Close room
2.Send message in room (just live message, offline message might be supported in future)

I have done logic for application, but I'm considering where to save chat room data (message,room information, and users in room) ? I see there are 2 options:

1. Application variable
2. Using file or database

-What if I saved in Application variable:
In case of there are 2000 rooms and 10000 users online, mean I have to persistence in Application variable (actually in RAM memory) information of 2000 rooms, more than 10000 message (text), these numbers might be increased by second if there are more users online in real time. and what's next ? I don't know what will happen to server, crash ? or my web app will be terminated ? whatever I don't want both results !

-What if I saved in file or DB (i.e: SQL Server DB)
Because of web application, clients have to send request every 1 second to fetch data (messages and user list in room). So in case of there are 2000 rooms and 10000 users online, means they will make 10000 requests every 1 second to DB. I don't know what will happen to DB, there are a lot of connections and in EVERY 1 second, can

Which font cache service should be running?

  
After the VS2010 installation, there are two font cache services running now: WPFFontCache_v0400.exe and PresentationFontCache.exe. Which one should be stopped?   The first one is from .Net Framework 4 and the 2nd one is from .Net Framework 3.0.

How to save FontFamily and other Font settings as strings

  

I need to be able to save various font settings (FontFamily, FontStyle, FontWeight, etc.) to strings, so I can save to a configuration file or to XML.  How do I do this?  And then, how to I convert back from a string to a FontFamily.  I tried constructing FontFamily with a string argument, but it works with absolutely anything as the string.  I guess part of my issue is that I am still trying to understand all these font classes in WPF.  To me, it was so simple in WinForms to just deal with the Font class.  Now, to save all of the properties of a font, I have to save about 5 different classes.


John Anderson

Storing dataset in application cache

  

Hi,

I am writing a web page that returns a small volume of data from a database table. The database is polled every 1 second and the data will be the same for every user. As every user is accessing the same data, there is no need for each user to poll the database and use up db resource.

Therefore, I think I should be using application caching to store the data in a dataset. However, I am slightly stumped as to how to do this.... because how can i ensure that the dataset is kept up to date.

The only way I can think to do this is to have a master user/session (i.e. the first session in the application) that keeps the cache object updated every second, then other users can use that cache object. If the first session ends, then the next requestor of the cache will pick up responsibility for keeping the dataset up to date.

Can anyone think of another way to do this as it seems slightly messy!!!

Can I use a timer at application level that would keep the dataset up to date???


Save Workflow Runtime as Application State or Session State for a website with multiple users?

  

I used Windows Workflow Foundation 3.5 as a page flow navigation for a ASP.NET website's Previous and Next page navigation.

The site acts like a shopping cart and each user has his own session and user data.  The app only has one WF.  I am not sure if I should generate one Workflow Runtime for every user or for simply generate one workflow Runtime for the entire application in my case?   

In the global.asax:

void Application_Start(object sender, EventArgs e)
    {
       
    } 

void Application_End(object sender, EventArgs e)
    {
                         
    }
    
    void Session_Start(object sender, EventArgs e)
    {
        // Code that runs when a new session is started
        System.Workflow.Runtime.WorkflowRuntime workflowRuntime = new System.Workflow.Runtime.WorkflowRuntime(WorkflowManager.WorkflowRuntimeKey);

      

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend