Thursday, May 17, 2012
Google Custom Search

ClearCanvas Highlights

Download our Open Source software
Watch some Videos
Get the Source
Check out our Licensing
Join our  Forums
Some Research: OICR IPP-Trials

Our Community

Membership Membership:
Latest New User Latest: JBauza
New Today New Today: 19
New Yesterday New Yesterday: 33
User Count Overall: 22559

People Online People Online:
Visitors Visitors: 16
Members Members: 0
Total Total: 16

Online Now Online Now:

ClearCanvas Community Forums

Configuration question/exception
Last Post 2010-05-10 01:04 PM by stewart. 3 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
whodges
Advanced Member
Advanced Member
Posts:44

--
2010-04-15 04:54 PM  

Hey all:

You may not come across this problem yourselves, but it's a bit of an issue for me.  Any insight you have off the top of your heads would be greatly appreciated.

The problem stems from me wanting to override default settings.  Let's use ClearCanvas.Desktop.ToolStripSettings as an example.  Say I want WrapLongToolstrips to default to 'True' rather than 'False' for my distribution of CC and my plugins.  I figured that if I copied the ToolStripSettings XML into ClearCanvas.Desktop.Executable.exe.config (I've copied both the section and the settings, and left them as 'userSettings') and changed the default value of WrapLongToolstrips to 'True', this would work.  It does...sort of.

The default value gets changed successfully; WrapLongToolstrips is 'True'.  The problem stems from when I try to change the toolbar settings via Options-->Toolbar.  If I change the WrapLongToolstrips settings value in this manner, and then close ClearCanvas, my settings saved in the 'User.config' file that's buried in 'Documents and Settings' (I left the settings caching parameter as 'MachineToLocalUser').  Unfortunately, 'User.config' ends up getting corrupted - the section declaration for ClearCanvas.Desktop.ToolStripSettings is missing.  This means that when I try to relaunch ClearCanvas, it tries to load an invalid 'User.config' file, and crashes immediately with a configuration exception.  Nothing gets logged though, since the app didn't actually start.  You just get the "ClearCanvas encountered a problem and needs to close" message box.

If I delete the 'User.config' file at this point, ClearCanvas will run again.  Likewise, if I remove my overridden settings from ClearCanvas.Desktop.Executable.exe.config, everything's fine.  I can change and save the Toolbar options without any problems.

Any idea what I'm doing wrong here?  Am I even allowed to override default setting values this way, or any other way for that matter?

stewart
Senior Member
Senior Member
Posts:2128

--
2010-04-20 11:42 PM  
Hey Wes, I just tried out what you described and it works ok for me. What you're doing should be fine; that's the standard way to override the default values for application and user scoped settings.

The missing section in the user.config file is actually ok, I believe, because the configuration system stores the user.config as a diff with the "default" user profile, which is basically the binary defaults combined with the overrides in the exe.config file. When I tried it out, my user.config was also missing the section element, but my workstation didn't crash when I started it up after the change.

I know it's probably vanilla, but can you post what you put in the exe.config file? Also, are you able to catch the exception in Studio? If so, can you post it?

I'm kinda grasping at straws here, so any more info you can provide will help.

All the best,
Stewart
Real-time support available to Clinical Edition and Team Edition customers
whodges
Advanced Member
Advanced Member
Posts:44

--
2010-05-03 01:04 PM  

Alright - this is interesting.

Since posting this, I've moved to Windows 7, and I can't reproduce this anymore.  The user.config file is missing the declaration, but there's no crash like you described.  I was on XP before, and the crash would happen.  Oh well.  Onwards and upwards.

By the way, we're finally nearing release for the next version of our stuff.  I've got another block of CC changes (not too bad - some you should find very beneficial, namely non-symmetrical image box layout auto-arrangement) - I'll have to get on that soon.  I'm sure you're thrilled. :)

 

stewart
Senior Member
Senior Member
Posts:2128

--
2010-05-10 01:04 PM  
I AM thrilled, Wes :)

Send on the patch(es) when you're ready.
Real-time support available to Clinical Edition and Team Edition customers
You are not authorized to post a reply.

Active Forums 4.1
Copyright 2012 ClearCanvas Inc.