.NET Framework version issue
-
User machine had .NET framework version 1.0 on his machine. Later after it was updated to version 1.1, my application started to behave erratically. The main erratic behaviour was in firing of event. When the form loads, I programmetically sets the selectedIndex for ComboBox, which then fires SelectedIndexChanged event. This was the normal behaviour. But now setting the selectedIndex for ComboBox programmetically doesn't fire the event. When I go to help-->About in ".Net Framework development environment" I see the version 1.0 (1.0.3705), which means appliction was built on version 1.0. Target machine has both 1.0 and 1.1, and from Micrsoft website I found that application built using 1.0 deafult to 1.0 framework. http://msdn.microsoft.com/netframework/technologyinfo/versioncomparison/default.aspx[^] Any pointers for this erratic behaviour
-
User machine had .NET framework version 1.0 on his machine. Later after it was updated to version 1.1, my application started to behave erratically. The main erratic behaviour was in firing of event. When the form loads, I programmetically sets the selectedIndex for ComboBox, which then fires SelectedIndexChanged event. This was the normal behaviour. But now setting the selectedIndex for ComboBox programmetically doesn't fire the event. When I go to help-->About in ".Net Framework development environment" I see the version 1.0 (1.0.3705), which means appliction was built on version 1.0. Target machine has both 1.0 and 1.1, and from Micrsoft website I found that application built using 1.0 deafult to 1.0 framework. http://msdn.microsoft.com/netframework/technologyinfo/versioncomparison/default.aspx[^] Any pointers for this erratic behaviour
Yes, the frameworks do run side by side and your application will use the version it's built against if available. If not, it will use a newer one or whatever you configure as a supported runtime in your app.config file. If your application is behaving eratically, it's possible that 1.1 was not installed correctly, but I've only seen this when installing in reverse order (doesn't happen all the time, but seems pretty common). You might want to add code in your application (even if all it doesn't is use the
DefaultTraceLister
a laTrace.WriteLine
) to list the assemblies currently loaded into your default AppDomain, along with their versions. Version 1.0.3705.0 (hopefully .228, which is 1.0 SP2) is .NET 1.0 and 1.0.5500.0 is 1.1. As far as the specific event problem you mentioned - are you sure this is the same codebase? The event hasn't changed from one version to the other, nor will it most likely (for backward compatibility). The only other thing I can think of is that something else was hosed on this system. The Windows Forms controls encapsulate the Windows Common Controls (native controls). If the machine got screwed up somehow - though you'd most likely notice in other applications - the controls might not work correctly, and would most likely fail all together.Microsoft MVP, Visual C# My Articles
-
Yes, the frameworks do run side by side and your application will use the version it's built against if available. If not, it will use a newer one or whatever you configure as a supported runtime in your app.config file. If your application is behaving eratically, it's possible that 1.1 was not installed correctly, but I've only seen this when installing in reverse order (doesn't happen all the time, but seems pretty common). You might want to add code in your application (even if all it doesn't is use the
DefaultTraceLister
a laTrace.WriteLine
) to list the assemblies currently loaded into your default AppDomain, along with their versions. Version 1.0.3705.0 (hopefully .228, which is 1.0 SP2) is .NET 1.0 and 1.0.5500.0 is 1.1. As far as the specific event problem you mentioned - are you sure this is the same codebase? The event hasn't changed from one version to the other, nor will it most likely (for backward compatibility). The only other thing I can think of is that something else was hosed on this system. The Windows Forms controls encapsulate the Windows Common Controls (native controls). If the machine got screwed up somehow - though you'd most likely notice in other applications - the controls might not work correctly, and would most likely fail all together.Microsoft MVP, Visual C# My Articles
On my machine I tested the application by modifying .exe.config file. When I force it to go to version 1.1, it gives the same erratic behaviour (i.e. not firing SelectedIndexChanged event) So to me it looks like, it is backward compatibility issue. For now I will include following in .exe.config file on client machine. If really this is an issue (and not something that I am missing), it will lead to compatibility problms. Thanks Heather for your feedback Ruchi
-
On my machine I tested the application by modifying .exe.config file. When I force it to go to version 1.1, it gives the same erratic behaviour (i.e. not firing SelectedIndexChanged event) So to me it looks like, it is backward compatibility issue. For now I will include following in .exe.config file on client machine. If really this is an issue (and not something that I am missing), it will lead to compatibility problms. Thanks Heather for your feedback Ruchi
"Heath", actually. This is odd. That behavior shouldn't have changed. It's still supported and I highly doubt the related IL for firing the event works differently, since few changes were made from 1.0 to 1.1, and most were for performance reasons. What does your event handler hook-up and handler method look like?
Microsoft MVP, Visual C# My Articles
-
"Heath", actually. This is odd. That behavior shouldn't have changed. It's still supported and I highly doubt the related IL for firing the event works differently, since few changes were made from 1.0 to 1.1, and most were for performance reasons. What does your event handler hook-up and handler method look like?
Microsoft MVP, Visual C# My Articles
One of my doubts that it was built using 1.0, and why is it not to going to 1.1 version has been confirmed. Actually IT support team, uninstalled 1.0 and then they installed 1.1, that's why upon not finding the default version application goes to 1.0. When the form loads, I fill the combobox, and then set the selecetdIndex on that combobox by following code cboCompany.DataSource =null; cboCompany.DisplayMember = "CompanyName"; cboCompany.ValueMember = "CompanyCd"; cboCompany.DataSource = m_dscompanydeskbook.Tables["Company"]; cboCompany.SelectedIndex=GetSelectedIndex(cboCompany, "CSC", "CompanyCd"); And there is one event private void cboCompany_SelectedIndexChanged(object sender, System.EventArgs e) { } which is supposed to fire upon getting past this line:- cboCompany.SelectedIndex=GetSelectedIndex(cboCompany, "CSC", "CompanyCd"); Thanks Ruchi
-
One of my doubts that it was built using 1.0, and why is it not to going to 1.1 version has been confirmed. Actually IT support team, uninstalled 1.0 and then they installed 1.1, that's why upon not finding the default version application goes to 1.0. When the form loads, I fill the combobox, and then set the selecetdIndex on that combobox by following code cboCompany.DataSource =null; cboCompany.DisplayMember = "CompanyName"; cboCompany.ValueMember = "CompanyCd"; cboCompany.DataSource = m_dscompanydeskbook.Tables["Company"]; cboCompany.SelectedIndex=GetSelectedIndex(cboCompany, "CSC", "CompanyCd"); And there is one event private void cboCompany_SelectedIndexChanged(object sender, System.EventArgs e) { } which is supposed to fire upon getting past this line:- cboCompany.SelectedIndex=GetSelectedIndex(cboCompany, "CSC", "CompanyCd"); Thanks Ruchi
It will only fire if you've hooked-up the event:
cboCompany.SelectedIndexChanged +=
new EventHandler(cbo_Company_SelectedIndexChanged);If IT uninstalled 1.0, then they're dumb (go figure). Your app should still work under 1.1, however, as long as you don't use any deprecated classes, methods, etc.
Microsoft MVP, Visual C# My Articles