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

No tags for this post.

Related posts

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


 

Twitter Updates