-3

Currently I am working on a project with the Silverlight technology based on a 3tiers architecture (DataFormation, BusnessFormation, Chalenge) including:

  • DataFormation: is a project of type class library
  • BusnessFormation: is a project of type class library
  • EChalenge: is a presentation layer in silverlight realize

The problem I encountered, and I still can not solve it is to create a web service that will allow me to call the class in the Library "SqliChalenge" layer (the layer presentation, carried out in Silverlight).

Attached a screenshot of the project architecture + capture the error I encountered when I try to add references.

enter image description here

J. Steen
  • 15,470
  • 15
  • 56
  • 63
Theboss
  • 47
  • 2
  • 11
  • 4
    Could you explain your problem in English? This is an international site and most people here don't speak French. – Marton Nov 20 '14 at 11:50
  • 1
    Is Dataformation a Class Library or a Silverlight Class Library? you cant add Class Libraries to a silverlight project, they require the CLR which silverlight does not have access too. – Alex Anderson Nov 20 '14 at 11:56
  • yes Dataformation and Busness Formation are class library , only Echallenge that is a silverlight project , and i would like to add references into the silverlight project – Theboss Nov 20 '14 at 13:03

1 Answers1

0

I suspect your problem results from the fact that your Silverlight project can only reference class libraries that are built against the Silverlight .NET Framework subset. (see Alex Andersons comment)

I don't think it is possible (meaning officially supported) to transform an existing standard class library project into a Silverlight class libary project.

If you inspect the .csproj files you'll notice the differences:

Standard C# class library project

...
<PropertyGroup>
  <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
  <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
  <ProjectGuid>{DFDAE6D4-0A0A-42C6-915F-31973E630AC9}</ProjectGuid>
  <OutputType>Library</OutputType>
  <AppDesignerFolder>Properties</AppDesignerFolder>
  <RootNamespace>ClassLibrary1</RootNamespace>
  <AssemblyName>ClassLibrary1</AssemblyName>
  <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
  <FileAlignment>512</FileAlignment>
</PropertyGroup>
...

Silverlight class library project:

...
<PropertyGroup>
  <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
  <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
  <ProductVersion>8.0.50727</ProductVersion>
  <SchemaVersion>2.0</SchemaVersion>
  <ProjectGuid>{F5D0D210-C435-46C6-909A-1DE3BB3DEE3B}</ProjectGuid>
  <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
  <OutputType>Library</OutputType>
  <AppDesignerFolder>Properties</AppDesignerFolder>
  <RootNamespace>SilverlightClassLibrary1</RootNamespace>
  <AssemblyName>SilverlightClassLibrary1</AssemblyName>
  <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
  <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
  <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
  <SilverlightApplication>false</SilverlightApplication>
  <ValidateXaml>true</ValidateXaml>
  <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
</PropertyGroup>

Try adding a Silverlight class libary project to your solution and reference it from your Silverlight presentation layer project.

If the reference works, just copy over your code from Business and Data layer projects.

Filburt
  • 17,626
  • 12
  • 64
  • 115