Posted on 10. Oct, 2008 by Wim Haanstra in C#, Snippets.

 

As I mentioned earlier, I moved my hosting to MyDomain.com, which has a nice Windows based hosting plan. There is only one problem, they are running .NET Framework 2.0 and don’t have the intention to actually upgrade it for you.

I wrote the backend of my iPhone app in C# 3.5, using LINQ and Ajax, so this application wouldn’t run on the MyDomain.com hosting. I knew this before I took the hosting, but still… I love LINQ and I want to use it!

So, I actually was thinking, how do I get this to run? Well it is easier then I thought. All you need to do is precompile your application locally and upload it to your hosting.

I am precompiling using a small batch file I wrote:

md %2
C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -p %1 -v / %2

The batch accepts 2 parameters. Parameter 1 is the location of your project sources and the 2nd parameter is the directory where you want to store your precompiled app.

After I uploaded the precompiled app, I still received a few errors about DLL’s not found, so I actually copied some 3.5 based DLL’s from my Windows GAC.

Here’s the list of DLL’s I had to copy, it could be that you need a different set of DLL’s based on the functionality you used.

System.Core.dll
System.Data.DataSetExtensions.dll
System.Data.Linq.dll
System.Web.dll
System.Web.Extensions.dll
System.Xml.Linq.dll

Those were all the files I needed to get Linq up and running :D .

kick it on DotNetKicks.com

3 Responses to “Getting .NET 3.5 apps to run on 2.0 hosting”

 
  1. One last thing says:

    While it only affects a very small number of people, .NET 3.5 won’t run on Windows Server 2000.

  2. depl0y says:

    Ah ok, it won’t run with this method either? I dont think so indeed, but maybe someone can verify this?

  3. Ernie Townsend says:

    e5it39453hul8qoy


Leave a Reply


 

WallPaper3 Stats

Latest Images

What I'm Doing...

  • The end of working here is getting closer and closer. Is it bad to do a countdown? 6.5 days... 4 hrs ago
  • Collecting my tax numbers, getting ready to file them. A lot of work.. 15 hrs ago
  • Care to twitter about the WallPaper 3 release? http://itunes.apple.com/nl/app/wallpaper/id292397567?mt=8 is the link to the app. 22 hrs ago
  • Ow, I hate switching between PC and Mac everytime I need Photoshop or Visual Studio. Why is VS so slow in Parallels (5)? 22 hrs ago
  • WallPaper is reduced in price! $0.79, until WallPaper Free is released! 22 hrs ago
  • I installed Tweetie on my mac. Got it with the MacHeist deal. It looks really nice! 1 day ago
  • Making some sort of banner. Should probably do more advertising. 1 day ago
  • Finishing up projects @ my current employer, typing a lot in Word... 1 day ago
  • More updates...

Posting tweet...

Powered by Twitter Tools