Reputation: 5550
From my understanding, if not mistaken, release mode should compile with more optimization and hence the size is smaller.
I'm developing a WPF C# application, when I select Release mode
, my application goes haywired but it works fine in Debug mode
. May I know is it even possible? What is the most common factor for this to happen?
Update:
By right when the application load, landing page after login will display information that retrieved from database. When in debug mode
, the information does show as expected. But in Release mode
, the information does not show.
There is no problem in Database connection because if there is, user wouldn't be able to login at all.
I'm sorry that I couldn't share any codes as the project is way too huge. I'm expecting more on a general understanding between a Release mode
and Debug mode
and to find out the possible cause of the situation I'm facing. Any helps would be very much appreciated.
Upvotes: 0
Views: 2444
Reputation: 115
If you use MVVM Light there are two differents mode:
static ViewModelLocator()
{
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
if (ViewModelBase.IsInDesignModeStatic)
{
SimpleIoc.Default.Register<IDataService, Design.DesignDataService>();
}
else
{
SimpleIoc.Default.Register<IDataService, DataService>();
}
SimpleIoc.Default.Register<MainWindowViewModel>();
}
SimpleIoc.Default.Register fails at IsInDesignModeStatic if the Interface is in different assembly - there are many problems. It is not enough data to solve this problem.
Upvotes: 0
Reputation: 6961
The biggesdt problem here is that Debug and Release are just placeholders for a particular configuration within your projects. You can actually change what they mean project by project.
By default however the differences are actually fairly small. Click for large image
What this means is that you can use the configuration manager (Right click Solution in the Solution Explorer) to take your Debug configuration, and create a new one based on it, and slowly change these properties over so you can find what the problem actually is.
One commonly misunderstood trick is that you can still Debug a release assembly (even after its been optimized). So you should be able to get a far better understanding of what is going on, and then ask your question again.
Upvotes: 2