Rolling back target .NET framework

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

30 Replies - 1388 Views - Last Post: 27 November 2013 - 11:11 AM Rate Topic: -----

#1 synlight  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 89
  • View blog
  • Posts: 582
  • Joined: 14-September 11

Rolling back target .NET framework

Posted 25 November 2013 - 08:51 AM

Right now my application targets .NET 4.5

All of the other machines in the office are running 4.0

I'm still debating how I want to handle this, if I should have them download 4.5 or rollback the target framework to 4.0.

Since the machines this app will run on are very old, and running XP, I am thinking I should just rollback to .NET 4.0. If I were to do that, what does it mean for my application? I think the only resource that uses 4.5 is the HTML Agility Pack, so I could spend some time rewriting those functions manually. I just want to know what to expect beforehand, if I decide to do it.

Of course, I will back up my original solution fully before changing the target.

What would you do in this situation? It's a Windows application, that will be widely deployed on machines of varying age. Thanks guys!!

Is This A Good Question/Topic? 0
  • +

Replies To: Rolling back target .NET framework

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9196
  • View blog
  • Posts: 34,528
  • Joined: 12-June 08

Re: Rolling back target .NET framework

Posted 25 November 2013 - 09:21 AM

Just change the solution's target to 4.0 and see what happens when you recompile.. in theory it shouldn't be a huge issue, but I am not sure what you are using.

I wouldn't push the issue on making everyone move to 4.5 unless your app is some sort of high-prio/mission critical thing where the bosses are on board..
Was This Post Helpful? 1
  • +
  • -

#3 synlight  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 89
  • View blog
  • Posts: 582
  • Joined: 14-September 11

Re: Rolling back target .NET framework

Posted 25 November 2013 - 11:01 AM

Thanks modi! The rollback seems to have worked, in that my tester is able to install the application on his machine.

Now, when he clicks on a button to register as a new user, the application crashes.

Sigh.

I guess we all have to learn somehow, but I'm not sure where to start. I've never deployed an application before.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9196
  • View blog
  • Posts: 34,528
  • Joined: 12-June 08

Re: Rolling back target .NET framework

Posted 25 November 2013 - 11:07 AM

Check the 'event viewer' in the admin tools in the control panel.. failing that start going line by line over the login.. make sure to use try/catches that write out errors to a text file, etc..
Was This Post Helpful? 1
  • +
  • -

#5 synlight  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 89
  • View blog
  • Posts: 582
  • Joined: 14-September 11

Re: Rolling back target .NET framework

Posted 25 November 2013 - 11:20 AM

Ahhh thank you!!

It's an unhandled xamlparse error. I have no idea what would cause that, my xaml is correct. I will figure it out, though, now that I know how to find a bread crumb.

My main window has 3 buttons and a hyperlink, all of which open a new window. Clicking on any of them is causing the application to crash. Here is the error:

Description: The process was terminated due to an unhandled exception.
Exception Info: System.Windows.Markup.XamlParseException

This is a WPF application, trying to install on an XP machine. 32 bit, with SP3.
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9196
  • View blog
  • Posts: 34,528
  • Joined: 12-June 08

Re: Rolling back target .NET framework

Posted 25 November 2013 - 11:22 AM

See about getting an inner exception to the exception.. that should provide a bit more direction.
Was This Post Helpful? 0
  • +
  • -

#7 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4480
  • View blog
  • Posts: 7,803
  • Joined: 08-June 10

Re: Rolling back target .NET framework

Posted 25 November 2013 - 11:47 AM

Another thing to do is consider some sort of logging framework so you can output errors (and their inner exceptions) to a log file/database/email/whatever.

I like log4net, but there's plenty (ELMAH, MS Enterprise Library, etc...)
Was This Post Helpful? 1
  • +
  • -

#8 synlight  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 89
  • View blog
  • Posts: 582
  • Joined: 14-September 11

Re: Rolling back target .NET framework

Posted 25 November 2013 - 11:49 AM

I need to get my hands on an XP machine. I'm having to debug through a coworker and it's getting frustrating.

If I set up a VM on my own machine, it's completely sandboxed, right? My current machine config will have no bearing on its' behaviors?

I'm not seeing an Inner Exception, but here are the first 2 references in the XamlParse exception:

Exception Info: System.Windows.Markup.XamlParseException
Stack:
at System.Windows.Markup.XamlReader.RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri)
at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)

This post has been edited by synlight: 25 November 2013 - 11:50 AM

Was This Post Helpful? 0
  • +
  • -

#9 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4480
  • View blog
  • Posts: 7,803
  • Joined: 08-June 10

Re: Rolling back target .NET framework

Posted 25 November 2013 - 11:53 AM

Quote

My current machine config will have no bearing on its' behaviors


Other than the performance of the virtual hardware, no. It's a virtual computer; it has its own OS and programs. You should use VMs for testing many things. Remember to save the state of them frequently so you can roll back when you need to.

Also, exceptions that get thrown and unhandled don't necessarily expose their InnerException to you. But most logging frameworks will automatically check for inner exceptions and log them as well.
Was This Post Helpful? 1
  • +
  • -

#10 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5510
  • View blog
  • Posts: 11,815
  • Joined: 02-June 10

Re: Rolling back target .NET framework

Posted 25 November 2013 - 06:57 PM

I'm a huge beleiver in using VMs as I have posted many time.
They let you debug directly into the target OS. That means... YOur solution is running in your 'host' OS (Win7x64 for example) but the debug is sent to the VM for 'remote debugging', just as if it were a different machine on your network.

This lets you debug in that target PC, lets Visual Studio get all the debug feedback from the VM etc.

There is no need to play silly games with pop-up message boxes, or wondering *why* a crash happened in WinXPx32 for example because you will get the exception and hit all your breakpoints and see the values of local values just as if you were debugging on your host PC.

I keep one harddrive on my PC filled with just VM images. Win7x64, Win7x32, XPx64, XPx32 and so on.
Was This Post Helpful? 1
  • +
  • -

#11 synlight  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 89
  • View blog
  • Posts: 582
  • Joined: 14-September 11

Re: Rolling back target .NET framework

Posted 26 November 2013 - 06:08 AM

Okay I'm ready to tackle this today! I have a few questions.

I have a server sitting around that I'm going to set up as a testing machine.

1)What VM software do you guys use? There are a lot of options, hoping for some feedback before I choose one.

2)For each VM I run, I'm going to need a valid copy of that OS,correct? I did get us approved for the BizSpark program so I can get a few copies for free. SO I need to download the OS, burn it to a disk, and install it on my virtual image just like a regular computer?

3)thln.. can you elaborate on debugging on a VM? Or is there a tutorial out there I can use to get that set up. It seems like an ideal solution!

As always, thank you!
Was This Post Helpful? 0
  • +
  • -

#12 Robin19  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 272
  • View blog
  • Posts: 552
  • Joined: 07-July 10

Re: Rolling back target .NET framework

Posted 26 November 2013 - 06:38 AM

See if your place of employement will buy an MSDN license. The license will let you download and use any previous Microsoft technology for testing purposes.
Was This Post Helpful? 1
  • +
  • -

#13 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3570
  • View blog
  • Posts: 11,104
  • Joined: 05-May 12

Re: Rolling back target .NET framework

Posted 26 November 2013 - 06:47 AM

I use VirtualBox now, but I used to use Virtual PC and MS Virtual Server. Before that, I used VMWare. As I recall tlhIn`toq recommends VMWare, and it's what I "use" at work as well. (I put the word "use" in quotes because although all my dev, test, and production machines are all VMs, the group that manages the VMs don't let me access any of the VM functionality like the ability to take snapshots, or adjust the number of CPUs or amount of RAM or diskspace.)

Another issue you'll have to deal with is the licensing. As I understand things, for business purposes, you'll need to pay for VirtualBox. If you are going to pay, you might as well pay Microsoft or VMWare.

Yes, you'll need the OS license for each target VM. If you have an MSDN account, you can download ISOs of the OSes, and install on the VMs and it should be covered since you are using the OS for development purposes. To use for production, I believe that you have to get a license for each.

For debugging a VM remotely, it is the same as regular remote debugging: Remote Debugging Setup.

The high level summary is that you install as small monitoring program on the VM, and run it. Then you run your program on the VM. On your development PC with Visual Studio, your use Debug.Attach and point to the VM, and select the process that you want to debug. Viola! You'll be debugging as if you were debugging on your own machine.
Was This Post Helpful? 2
  • +
  • -

#14 synlight  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 89
  • View blog
  • Posts: 582
  • Joined: 14-September 11

Re: Rolling back target .NET framework

Posted 26 November 2013 - 06:49 AM

We have some MSDN benefits as a BizSpark member. 1 TB of free software downloads, $150/month credits on Azure, etc. I do have past Windows versions available to download for free, so that's helpful. I was thinking I could set the VMs up on Azure, but I am limited to Win Server and Linux machines. So, I figured I may as well use this unit that's been sitting in my office for 3 months gathering dust.
Was This Post Helpful? 0
  • +
  • -

#15 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4480
  • View blog
  • Posts: 7,803
  • Joined: 08-June 10

Re: Rolling back target .NET framework

Posted 26 November 2013 - 08:04 AM

Quote

SO I need to download the OS, burn it to a disk, and install it on my virtual image just like a regular computer


Just FYI, you don't actually have to burn it. Most VM hosts can read .ISO files, and even if they can't, there are products like VirtualDaemon and Virtual Clone Drive that will let you mount ISOs as if they were a disk drive. Also, the read speed is much faster (since it's already on your HDD and HDD is faster than optical drives).

You should be able to get the ISOs from the MSDN if you have BizSpark. I had it myself for a while.
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3