OT - .NET Version Issue

OT - .NET Version Issue

Old forum URL: forums.lhotka.net/forums/t/8407.aspx

ErikJL posted on Monday, January 25, 2010

Sorry to post this here, but I know this is an active forum with very knowledgeable people. I tried searching online but I don't think I'm phrasing my issue correctly, so I'm not seeing any relevant results and am running out of time.

I've built an app on my machine which happens to have .NET 3.5. However, the business is using .NET 2.0, and when I try to install the app on a 2.0 box, it fails with a message indicating .NET 3.5 is required. Upgrading the target machine to .NET 3.5 is not an option (long story). Is there any way to make the app compatible? I didn't see any options in the setup project to do this.

dlambert replied on Monday, January 25, 2010

If you're not actually using any of the .Net 3.5 features, you can change the solution to target the 2.0 framework when it builds (see "Target Framework" in the project's properties). If you're using 3.5 features, then you're going to have to upgrade client machines to the 3.5 framework.

JonnyBee replied on Tuesday, January 26, 2010

Hi Erik,

Are you using CSLA in your application?

Here are some hints that may help you on your path:
CSLA N2 also contains LinqBridge and will run on .NET 2.0 with SP1 (SP1 is required for MethodCaller in CSLA.NET).

LINQBridge is a reimplementation of all the standard query operators in Framework 3.5's Enumerable class (Linq2Objects) and also includes Framework 3.5's generic Func and Action delegates, as well as ExtensionAttribute, allowing you to use C# 3.0's extension methods in Framework 2.0.  LinqBridge will run on .NET 2.0 (even without SP1).

You will not have access to any libraries that require .NET 3.5 (such as EntitiyFramework, Linq2SQL and WCF) so for a CSLA prject your dataportal will only be able to use WebServices, Remoting or EnterpriseServices.

Yout setup project will not help you - rather you must set the target framework to .NET 2.0 on all your projects and remove references to 3.0 or 3.5 libraries. Then add a reference to LinqBridge (for C# 3.0 syntax) and resolve any leftover issues from usage of 3.0/3.5 libraries should do the trick.

ErikJL replied on Tuesday, January 26, 2010

Sorry I should have indicated the version we are using; we're using CSLA 3.0.5. I'm also not using any of the post .NET 2.0 functionality in any of the projects.

Thanks for showing me where to find the .NET version dependency info! I went through each project but unfortunately all were set to .NET 2.0 already. There are some other files in the setup project's "detected dependency" list I suspect may have .NET 3.5 dependancy, so one of those must be the culprit.

EDIT: SMDiagnostics.dll is in the dependancy list and looks to be version 3.0, and since it's referenced in the GAC, I'm assuming it's also dependant on .NET 3.0. I'm going to try excluding this first.

dlambert replied on Wednesday, January 27, 2010

I know you don't want to upgrade to 3.0, so this isn't directly applicable, but I thought it might be interesting to someone following this thread:


This is supposed to help w/ getting correct pre-reqs installed on client machines. I haven't tried it yet myself.

Copyright (c) Marimer LLC