Problem with DataContract on Shared Hosting

I am trying to upload an (VB) application that I've been working on and I've hit a major snag.
The program has been working fine on my test server, however when I upload the program to Godaddy's shared hosting it doesn't work. Several pages work fine however one particularly critical one crashes every time.
The error I receive is as follows:

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30002: Type 'DataContract' is not defined
VERSION INFO (Remote Server)
 Microsoft .NET Framework Version:2.0.50727.1434; ASP.NET Version:2.0.50727.1434

VERSION INFO (Local Server)
Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
I think that it may be a version issue but I have no idea how to approach fixing it in a shared hosting environment (and neither did tech support)

I would really appreciate any information you have on how to fix this. I am completely stuck and absolutely frantic about getting this program online. Thanks again for your help!
Imports System.Runtime.Serialization.Json
Imports System.IO
Imports System.Runtime.Serialization
<DataContract()> Public Class skill_ser          '<---Crashes Here
    <DataMember()> Public i As Integer
    <DataMember()> Public n As String
    <DataMember()> Public p As Integer
    <DataMember()> Public s() As skill_ser
    <DataMember()> Public a() As skill_ser
End Class

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I'm not sure how you deployed your code to your live server, but probably you uploaded not only sources, but also compiled binaries. The error states that the remote-server is using version 2.0.50727.1434 of ASP.NET and the local-server is using version 2.0.50727.3053 of ASP.NET. That actually means that the remote-server is using .NET Framework 2.0 SP1 and the local-server is using .NET Framework 2.0 SP2. I'm guessing that local-server is the GoDaddy server and remote-server is you trying to connect to it. I don't think the SP1 / SP2 is the real problem. However, the DataContract class is introduced in .NET Framework 3.0. In .NET 3.0 the binaries for ASP.NET still have the 2.0.x versions. Only the new base-classes from WinFX, like WPF, WCF and WWF have version 3.0.x. Although ASP still uses 2.0.x, it needs framework 3.0.x for the DataContact you use (WCF). My guess is that GoDaddy only has .NET framework 2.0 and not .NET framework 3.x on their servers. You absolutely need a host that provides .NET 3.0 in order to deploy a WCF application.
apocalypse910Author Commented:
Thank you very much for your response-

To clarify the version information was not part of the error - I added the information for troubleshooting purposes.  The local Server is my Home computer - (I intentionally caused an error to pull the version data) The Remote server information is pulled from the error page on my hosted site.

Sorry I didn't make that more clear- I just reread my post and I couldn't have formatted that any worse.

None of the compiled binaries were uploaded - I uploaded my aspx files and aspx.vb code behinds manually via FTP.

The runtime version selected on the server  ASP 2.0/3.0/3.5 - I assumed this to mean v3.5 with backwards compatibility to 2.0/3.0. For reference I  have the latest version installed on my computer.

I'm not entirely sure where this leaves me..
Thank you very much for taking a look at the problem- sorry for the bad formatting.

.NET 3.5 is indeed downward compatible with 3.0 and 2.0. You have 3.5 installed. But I think GoDaddy only has 2.0 installed. However, you need at least 3.0 to be able to use the DataContract and all other WCF classes. You should first verify the version of the .NET framework installed on the GoDaddy host. It is not neccesarily the same as the ASP.NET version. You can have 3.5 installed and use 2.0 for ASP.NET. Verify that at least 3.0 is installed on GoDaddy. If not, then look for another host that does provide .NET 3.0 or higher. Then it should work.
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

apocalypse910Author Commented:
Hmm.. i've been trying to get a straight answer from GoDaddy on this.. Here is what I found on their site.
Our hosting accounts running IIS 7 are compatible with ASP.NET runtime 3.5, a development framework that supports numerous Web technologies, including Language Integrated Query (LINQ), Windows Presentation Foundation (WPF), Windows Workflow Foundation (WF), Windows Communication Foundation (WC) and Silverlight. For more information, see .NET Framework.
I've confirmed that I'm running IIS7 so According to their info i'm on V3.5 (Unless i'm misreading) . I wonder if possibly something in my web.config is preventing it from targeting the correct version.

Thanks again for all of your help- I can't tell you how much I appreciate it.
apocalypse910Author Commented:
I just spent another 30 minutes on the phone with GoDaddy - They tested that the correct version is installed and functioning.. I also checked my Web.Config and can find nothing that would prevent the correct version from being used.

Also from the detailed compilier output

Microsoft (R) Visual Basic Compiler version 9.0.21022.8
Copyright (c) Microsoft Corporation.  All rights reserved.

D:\Hosting\3385989\html\sw\Show_Character.aspx.vb(1) : warning BC40056: Namespace or type specified in the Imports 'System.Runtime.Serialization.Json' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

Hmm.. .NET 3.5 is available, but neither System.Runtime.Serialization.DataContract and System.Runtime.Serialization.Json can be found. The only thing I can think of right now is that you are missing references to the assemblies System.ServiceModel.Web.dll and System.Runtime.Serialization.dll in your project-file.
Forget my last comment. I was a bit confused. In ASP.NET there are no project-files. But it seems that the GoDaddy host does not provide .NET 3.0 assemblies for you. So, in their IIS your site seems to have ASP.NET 2.0.x configured. This would normally be a setting in your IIS configuration. I'm not sure if you can modify that setting at the GoDaddy host. If you can you should set it to ASP.NET 3.0 or higher. If it is already set to 3.0 or higher, there might be something wrong with their configuration. If you can't modify it, you should ask them to do it for you.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
apocalypse910Author Commented:
     I just put another long call in to GoDaddy. Got a very helpful agent this time - they spent about 30 minutes on the line with the IT department. They haven't found the issue yet but it looks like they are finally taking  a close look at their own server configuration.  The ticket has been escalated so hopefully i'll have an answer soon.

    I can't seem to access anything at all under system.runtime.serialization. They looked into it during my last call but apparently the support agent had the IT department looking for one of my random internal classes rather than the library that was generating the error.

    It is possible that it was purposely disabled as part of the 'medium trust environment' on their shared hosting but I can't think why that would be the case.

   Thanks once again for all of your help - I'm going to go ahead and close the question- but I'll still post any developments in case anyone else hits the same problem.
Ok. Since they acknowledged the problem I'm sure they will sort it out. Good luck with that!
apocalypse910Author Commented:
Alright- I spent a week going back and fourth with tech support.

They tried to tell me that the data contract requires SP1- which is false.  Finally after being escalated a few times I was told that those particular classes are not supported. After further inquiries they explained that the classes I required are disabled because the hosting environment is configured as medium trust. I'm not sure what the specific security risk was but it appears that there is nothing I can do on GoDaddy without upgrading to the $50/month or so virtual dedicated server.

After further correspondence they agreed to refund the money I paid for the year of hosting. I found several shared hosting providers at a comparable price with a full-trust setup. I switched to Softsys Hosting and everything worked perfectly (plus I have a 5X higher database size limit- yay!)

Anyways thank you again for all of your help! I would still be combing through my own code trying to figure out what i did wrong if you hadn't pointed me in the right direction.

Hi. Very good to see you got everything sorted out! I think it is not a real security risk, but they probably decided it is too much of a risk (in sense of stability) to combine sites of different users when the functionality is of increasing complexity. And therefore they want some of the functionality to be split up in virtual servers. But they should have been clear about that. They should not say they support .net 3.5 if they do not completely support it. Anyway, good luck with it! Ciao.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.