Quantcast
Channel: Open RIA Services
Viewing all 124 articles
Browse latest View live

Commented Issue: [Required] incorrectly added to database generated properties [96]

$
0
0
When using EntityFramework and fluent configuration (or a code generation strategy without [DatabaseGenerated] attributes Ria Services will incorrectly infer that databasegenerated properties such as rowversion fields of type byte [] are required which can result in these entities not being able to be saved.

The issue has ben solved for properties with the [DatabaseGeneratedAttribute] in changeset 644c19da but the fix only worked for properties where the attribute was applied directly to the property and not for classes where it was specified in edmx or using code first fluent Api.


This should make old workarounds such as https://social.msdn.microsoft.com/Forums/en-US/9de7a69a-6dbf-4c06-aa68-62f34227dd8d/remove-required-attribute-on-entity-exposed-by-wcf-ria-service?forum=silverlightwcf obsolete.


Comments: Fixed in changeset a9a8520bd98e847614aa5913dee573851744ae14

Source code checked in, #67e67016f7073c9cafa9683522f83c018bab643d

Source code checked in, #85077899c3d47c88485483aad913aa62060e1518

Source code checked in, #1aa93f36a8b519d64c1fb28f841f423bc66f9928

Source code checked in, #6ff8a06410b29f76575d56f4e555b699f96d5878

$
0
0
Add extension points for WCF DomainClientFactory implementation * Add a new base-class WcfDomainClientFactory for WebDomainClientFactory that can be shared with soap and json endpoints in the future * Add extension points for customizing ChannelFactory creation by moving default ChannelFactory creation code to Wcf/WebDomainClientFactory

Source code checked in, #088b639b2a4274fc70eddf69bdc14e55570c4ad1

$
0
0
Add back silverlight specific codegen target Since the build ordering feature has some issues for silverlight projects in some cases add back the silverlight specific codegen target and add a build warning if using a version unsuitable for their project type.

Source code checked in, #ad3df2fb0ed3e95090dcfa1ca9e0b4a4bc63e33d

$
0
0
Add coverity build script Add script used for coverity analysis so anyone can do it

Source code checked in, #755ccaf4fd71f2d49fb3cccbbe0b9581eed42870

$
0
0
Fix bug in SOAP endpoint not reading query options from header

Source code checked in, #f9d4ee1ec9b97b337f559c8c3cd757d118ed3c64

$
0
0
Fix a couple of issues and codesmells found by sonarqube

Source code checked in, #68eb93ee06744fecee1c593e6884eefa9756410c

$
0
0
Add readonly to fields that never change

Source code checked in, #dc1dd7633da31fc2801505e548945d4ae28dbe82

Source code checked in, #d7df794d2ce93a64ef606eb9eff293e23db6a175

$
0
0
Remove redundant linked items from Hosting.Endpoints project Enable InternalsVisibleTo from Hosting to Hosting.Endpoints Ideally we should make all required types public so that we can remove the need for InternalsVisibleTo

Updated Release: 4.5.0 (Aug 20, 2016)

$
0
0

4.5.0

The goal of the release is to add improved cross platform support.

This is the first release with stable WPF support as well as (at least partioal) core support to many other platforms such as windows apps (and probably xamarin apps). For an example with both Silverlight, WPF and Windows 8 app see https://github.com/Daniel-Svensson/OpenRiaPlayground/tree/master/HttpClient

Known Issues

Workaround: The recommended approach for WPF projects is to have a separate library project for the code generation
  • Code generation has issues for platforms where dataannotations has moved from System.ComponentModel.DataAnnotations
This includes, windows phone as well as several of the portable library targets.
Code generation will succeed, but important attributes such as Key will be missing.
Workaround: Run code generation in a project targeting a supported platform and then use that dll (if possible) or directly link to the generated code from another project without the code generation installed.

RC2: (2016-11-09)

  • Added additional extension points for WCF based DomainClientFactory implementations
    • Add a new base-class WcfDomainClientFactory for WebDomainClientFactory
    • Add extension points for customizing ChannelFactory creation by moving default ChannelFactory
creation code to Wcf/WebDomainClientFactory
  • Fix bug in Soap (BasicHttpBinding) endpoint preventing query options from working
  • Add back Silverlight specific codegen package (and .targets file)
    • Fixes a bug wherr Visual Studio in some cases failed to load silverlight project
with a mesage that silverlight projects cannot dependend on non silverlight projects.
  • Automatic build ordering vill not work for silverlight clients.
  • A warning message has been added in case the "wrong" .targets file is used
  • Reduce size of OpenRiaServices.Endpoints
    • It now reuses internal types from Hosting assembly
    • Infrastructure:
      • Added nuget badges to README.md
      • Add script for coverity static analysis with a badge added to README.md
      • Run analysis with sonarqube and added badge for results to README.md

      RC1: (2016-08-20)

      • Fix #94 Slow first call to a service
        • Improved startup (and codegen) performance
      • Fix #92 EntityCollection load is very slow for large number of entities
      • Improved nuget behaviour for other targets than silverlight and desktop .net
      • Updated portable library to have the same implementation as non portable builds
      • Added netstandard 1.3 build (experimental) see https://docs.microsoft.com/sv-se/dotnet/articles/standard/library for netstandard information
      • AssemblyVersion updated to 4.0.0.0 for silverlight and portable build
        • Silverlight support automat assembly redirection to higher versions so manual redirection should not be required for any target platform

      Beta3: (2016-04-17)

      • Fix #90 FormsAuthentication on Desktop Platforms
        • Desktop client now support Cookies by default (which means Forms authentication just works)
        • Can be controlled via WebDomainClientFactory.CookieContainer
      • WebDomainClientFactory can now be overridden (bug in beta2)
      • Enforce build ordering so we don't get error saying web project did not build which is one of the errors issue #73 Code generation fail for WPF if xaml references local types
        • You will se a new project reference "OpenRiaServices Server Project Link" in projects with the code genereation enabled.
      • Automatically generate WebContext for .exe projects
      • Use msbuild property OpenRiaGenerateApplicationContext to control webcontext generation instead of just using SilverlightApplication variable
      • Fix #91 Difference in validation behaviour between Silverlight and .net
        • Desktop version now uses same validation logic as Silverlight build
      • ApplicationServices classes are moved to the Client assembly
        • This means that portable libraries and windows apps can now access them and have AuthenticationServices generated
      • All project now compiles
      • Appveyour compatibility - all projects now builds successfully on ci.appveyor.com


      Beta2: (2016-02-16)

      Beta1: (2016-02-07)

      DomainClientFactory

      The communication layer on the client can now be easily switched, for an example implementation se https://github.com/Daniel-Svensson/OpenRiaPlayground/tree/master/HttpClient

      PR: https://openriaservices.codeplex.com/SourceControl/network/forks/danneesset/openriaservices/contribution/8505

      What:
      • Introduces a new extension point for controlling what kind of DomainClient gets created and how.
      • Allow Desktop and Portable clients to specify a "Base uri" so that the default constructor generated by the code gen can work outside silverlight.

      This should hopefully remove the last strong dependency from the "core" Client on the current WCF based Client.Web assembly so that it becomes possible to add new service communication
      protocols in the future.

      Why?
      • Make the core assembly independent of how we communicate with the Server.
      • Allow new communication protocols in the future such as talking to the DomainController odata service, (soap/json endpoints) etc as well as for providing a portable alternative for the current Client.Web assembly for talking with normal DomainServices.

      How to use it:
      • Most user don't do anything at all, it will setup a DomainClientFactory automatically
      • For "advanced" scenarios the user can set DomainClient.DomainServiceFactory to a WebDomainClientFactory instance.

Ex: One can add the following code att application startup (ex: App ctor) before WebContext or any other DomainContext get created

```
DomainContext.DomainClientFactory = new WebDomainClientFactory()
{
ServerBaseUri = new Uri("http://localhost:51359/ClientBin/", UriKind.Absolute),
};
```

For another example with both Silverlight, WPF and Windows 8 app see https://github.com/Daniel-Svensson/OpenRiaPlayground/tree/master/HttpClient (WIn8 upp is not updater to beta1)

Updated Release: 4.5.0 (Aug 20, 2016)

$
0
0

4.5.0

The goal of the release is to add improved cross platform support.

This is the first release with stable WPF support as well as (at least partioal) core support to many other platforms such as windows apps (and probably xamarin apps). For an example with both Silverlight, WPF and Windows 8 app see https://github.com/Daniel-Svensson/OpenRiaPlayground/tree/master/HttpClient

Known Issues

Workaround: The recommended approach for WPF projects is to have a separate library project for the code generation
  • Code generation has issues for platforms where dataannotations has moved from System.ComponentModel.DataAnnotations
This includes, windows phone as well as several of the portable library targets.
Code generation will succeed, but important attributes such as Key will be missing.
Workaround: Run code generation in a project targeting a supported platform and then use that dll (if possible) or directly link to the generated code from another project without the code generation installed.

RC2: (2016-11-09)

  • Added additional extension points for WCF based DomainClientFactory implementations
    • Add a new base-class WcfDomainClientFactory for WebDomainClientFactory
    • Add extension points for customizing ChannelFactory creation by moving default ChannelFactory creation code to Wcf/WebDomainClientFactory
  • Fix bug in Soap (BasicHttpBinding) endpoint preventing query options from working
  • Add back Silverlight specific codegen package (and .targets file)
    • Fixes a bug where Visual Studio in some cases failed to load silverlight project with a mesage that silverlight projects cannot dependend on non silverlight projects.
    • Automatic build ordering vill not work for silverlight clients.
    • A warning message has been added in case the "wrong" .targets file is used
  • Reduce size of OpenRiaServices.Endpoints
    • It now reuses internal types from Hosting assembly
  • Infrastructure:
    • Added nuget badges to README.md
    • Add script for coverity static analysis with a badge added to README.md
    • Run analysis with sonarqube and added badge for results to README.md
  • Fix #96 [Required] incorrectly added to database generated properties

RC1: (2016-08-20)

  • Fix #94 Slow first call to a service
    • Improved startup (and codegen) performance
  • Fix #92 EntityCollection load is very slow for large number of entities
  • Improved nuget behaviour for other targets than silverlight and desktop .net
  • Updated portable library to have the same implementation as non portable builds
  • Added netstandard 1.3 build (experimental) see https://docs.microsoft.com/sv-se/dotnet/articles/standard/library for netstandard information
  • AssemblyVersion updated to 4.0.0.0 for silverlight and portable build
    • Silverlight support automat assembly redirection to higher versions so manual redirection should not be required for any target platform

Beta3: (2016-04-17)

  • Fix #90 FormsAuthentication on Desktop Platforms
    • Desktop client now support Cookies by default (which means Forms authentication just works)
    • Can be controlled via WebDomainClientFactory.CookieContainer
  • WebDomainClientFactory can now be overridden (bug in beta2)
  • Enforce build ordering so we don't get error saying web project did not build which is one of the errors issue #73 Code generation fail for WPF if xaml references local types
    • You will se a new project reference "OpenRiaServices Server Project Link" in projects with the code genereation enabled.
  • Automatically generate WebContext for .exe projects
  • Use msbuild property OpenRiaGenerateApplicationContext to control webcontext generation instead of just using SilverlightApplication variable
  • Fix #91 Difference in validation behaviour between Silverlight and .net
    • Desktop version now uses same validation logic as Silverlight build
  • ApplicationServices classes are moved to the Client assembly
    • This means that portable libraries and windows apps can now access them and have AuthenticationServices generated
  • All project now compiles
  • Appveyour compatibility - all projects now builds successfully on ci.appveyor.com


Beta2: (2016-02-16)

Beta1: (2016-02-07)

DomainClientFactory

The communication layer on the client can now be easily switched, for an example implementation se https://github.com/Daniel-Svensson/OpenRiaPlayground/tree/master/HttpClient

PR: https://openriaservices.codeplex.com/SourceControl/network/forks/danneesset/openriaservices/contribution/8505

What:
  • Introduces a new extension point for controlling what kind of DomainClient gets created and how.
  • Allow Desktop and Portable clients to specify a "Base uri" so that the default constructor generated by the code gen can work outside silverlight.

This should hopefully remove the last strong dependency from the "core" Client on the current WCF based Client.Web assembly so that it becomes possible to add new service communication
protocols in the future.

Why?
  • Make the core assembly independent of how we communicate with the Server.
  • Allow new communication protocols in the future such as talking to the DomainController odata service, (soap/json endpoints) etc as well as for providing a portable alternative for the current Client.Web assembly for talking with normal DomainServices.

How to use it:
  • Most user don't do anything at all, it will setup a DomainClientFactory automatically
  • For "advanced" scenarios the user can set DomainClient.DomainServiceFactory to a WebDomainClientFactory instance.

Ex: One can add the following code att application startup (ex: App ctor) before WebContext or any other DomainContext get created

```
DomainContext.DomainClientFactory = new WebDomainClientFactory()
{
ServerBaseUri = new Uri("http://localhost:51359/ClientBin/", UriKind.Absolute),
};
```

For another example with both Silverlight, WPF and Windows 8 app see https://github.com/Daniel-Svensson/OpenRiaPlayground/tree/master/HttpClient (WIn8 upp is not updater to beta1)

Released: 4.5.0 (Nov 09, 2016)

$
0
0

4.5.0

The goal of the release is to add improved cross platform support.

This is the first release with stable WPF support as well as (at least partioal) core support to many other platforms such as windows apps (and probably xamarin apps). For an example with both Silverlight, WPF and Windows 8 app see https://github.com/Daniel-Svensson/OpenRiaPlayground/tree/master/HttpClient

Known Issues

Workaround: The recommended approach for WPF projects is to have a separate library project for the code generation
  • Code generation has issues for platforms where dataannotations has moved from System.ComponentModel.DataAnnotations
This includes, windows phone as well as several of the portable library targets.
Code generation will succeed, but important attributes such as Key will be missing.
Workaround: Run code generation in a project targeting a supported platform and then use that dll (if possible) or directly link to the generated code from another project without the code generation installed.

RC2: (2016-11-09)

  • Added additional extension points for WCF based DomainClientFactory implementations
    • Add a new base-class WcfDomainClientFactory for WebDomainClientFactory
    • Add extension points for customizing ChannelFactory creation by moving default ChannelFactory creation code to Wcf/WebDomainClientFactory
  • Fix bug in Soap (BasicHttpBinding) endpoint preventing query options from working
  • Add back Silverlight specific codegen package (and .targets file)
    • Fixes a bug where Visual Studio in some cases failed to load silverlight project with a mesage that silverlight projects cannot dependend on non silverlight projects.
    • Automatic build ordering vill not work for silverlight clients.
    • A warning message has been added in case the "wrong" .targets file is used
  • Reduce size of OpenRiaServices.Endpoints
    • It now reuses internal types from Hosting assembly
  • Infrastructure:
    • Added nuget badges to README.md
    • Add script for coverity static analysis with a badge added to README.md
    • Run analysis with sonarqube and added badge for results to README.md
  • Fix #96 [Required] incorrectly added to database generated properties

RC1: (2016-08-20)

  • Fix #94 Slow first call to a service
    • Improved startup (and codegen) performance
  • Fix #92 EntityCollection load is very slow for large number of entities
  • Improved nuget behaviour for other targets than silverlight and desktop .net
  • Updated portable library to have the same implementation as non portable builds
  • Added netstandard 1.3 build (experimental) see https://docs.microsoft.com/sv-se/dotnet/articles/standard/library for netstandard information
  • AssemblyVersion updated to 4.0.0.0 for silverlight and portable build
    • Silverlight support automat assembly redirection to higher versions so manual redirection should not be required for any target platform

Beta3: (2016-04-17)

  • Fix #90 FormsAuthentication on Desktop Platforms
    • Desktop client now support Cookies by default (which means Forms authentication just works)
    • Can be controlled via WebDomainClientFactory.CookieContainer
  • WebDomainClientFactory can now be overridden (bug in beta2)
  • Enforce build ordering so we don't get error saying web project did not build which is one of the errors issue #73Code generation fail for WPF if xaml references local types
    • You will se a new project reference "OpenRiaServices Server Project Link" in projects with the code genereation enabled.
  • Automatically generate WebContext for .exe projects
  • Use msbuild property OpenRiaGenerateApplicationContext to control webcontext generation instead of just using SilverlightApplication variable
  • Fix #91 Difference in validation behaviour between Silverlight and .net
    • Desktop version now uses same validation logic as Silverlight build
  • ApplicationServices classes are moved to the Client assembly
    • This means that portable libraries and windows apps can now access them and have AuthenticationServices generated
  • All project now compiles
  • Appveyour compatibility - all projects now builds successfully on ci.appveyor.com


Beta2: (2016-02-16)

Beta1: (2016-02-07)

DomainClientFactory

The communication layer on the client can now be easily switched, for an example implementation se https://github.com/Daniel-Svensson/OpenRiaPlayground/tree/master/HttpClient

PR: https://openriaservices.codeplex.com/SourceControl/network/forks/danneesset/openriaservices/contribution/8505

What:
  • Introduces a new extension point for controlling what kind of DomainClient gets created and how.
  • Allow Desktop and Portable clients to specify a "Base uri" so that the default constructor generated by the code gen can work outside silverlight.

This should hopefully remove the last strong dependency from the "core" Client on the current WCF based Client.Web assembly so that it becomes possible to add new service communication
protocols in the future.

Why?
  • Make the core assembly independent of how we communicate with the Server.
  • Allow new communication protocols in the future such as talking to the DomainController odata service, (soap/json endpoints) etc as well as for providing a portable alternative for the current Client.Web assembly for talking with normal DomainServices.

How to use it:
  • Most user don't do anything at all, it will setup a DomainClientFactory automatically
  • For "advanced" scenarios the user can set DomainClient.DomainServiceFactory to a WebDomainClientFactory instance.

Ex: One can add the following code att application startup (ex: App ctor) before WebContext or any other DomainContext get created

```
DomainContext.DomainClientFactory = new WebDomainClientFactory()
{
ServerBaseUri = new Uri("http://localhost:51359/ClientBin/", UriKind.Absolute),
};
```

For another example with both Silverlight, WPF and Windows 8 app see https://github.com/Daniel-Svensson/OpenRiaPlayground/tree/master/HttpClient (WIn8 upp is not updater to beta1)

Updated Release: 4.5.0 (Nov 09, 2016)

$
0
0

4.5.0

The goal of the release is to add improved cross platform support.

This is the first release with stable WPF support as well as (at least partioal) core support to many other platforms such as windows apps (and probably xamarin apps). For an example with both Silverlight, WPF and Windows 8 app see https://github.com/Daniel-Svensson/OpenRiaPlayground/tree/master/HttpClient

Known Issues

Workaround: The recommended approach for WPF projects is to have a separate library project for the code generation
  • Code generation has issues for platforms where dataannotations has moved from System.ComponentModel.DataAnnotations
This includes, windows phone as well as several of the portable library targets.
Code generation will succeed, but important attributes such as Key will be missing.
Workaround: Run code generation in a project targeting a supported platform and then use that dll (if possible) or directly link to the generated code from another project without the code generation installed.

RC2: (2016-11-09)

  • Added additional extension points for WCF based DomainClientFactory implementations
    • Add a new base-class WcfDomainClientFactory for WebDomainClientFactory
    • Add extension points for customizing ChannelFactory creation by moving default ChannelFactory creation code to Wcf/WebDomainClientFactory
  • Fix bug in Soap (BasicHttpBinding) endpoint preventing query options from working
  • Add back Silverlight specific codegen package (and .targets file)
    • Fixes a bug where Visual Studio in some cases failed to load silverlight project with a mesage that silverlight projects cannot dependend on non silverlight projects.
    • Automatic build ordering vill not work for silverlight clients.
    • A warning message has been added in case the "wrong" .targets file is used
  • Reduce size of OpenRiaServices.Endpoints
    • It now reuses internal types from Hosting assembly
  • Infrastructure:
    • Added nuget badges to README.md
    • Add script for coverity static analysis with a badge added to README.md
    • Run analysis with sonarqube and added badge for results to README.md
  • Fix #96 [Required] incorrectly added to database generated properties

RC1: (2016-08-20)

  • Fix #94 Slow first call to a service
    • Improved startup (and codegen) performance
  • Fix #92 EntityCollection load is very slow for large number of entities
  • Improved nuget behaviour for other targets than silverlight and desktop .net
  • Updated portable library to have the same implementation as non portable builds
  • Added netstandard 1.3 build (experimental) see https://docs.microsoft.com/sv-se/dotnet/articles/standard/library for netstandard information
  • AssemblyVersion updated to 4.0.0.0 for silverlight and portable build
    • Silverlight support automat assembly redirection to higher versions so manual redirection should not be required for any target platform

Beta3: (2016-04-17)

  • Fix #90 FormsAuthentication on Desktop Platforms
    • Desktop client now support Cookies by default (which means Forms authentication just works)
    • Can be controlled via WebDomainClientFactory.CookieContainer
  • WebDomainClientFactory can now be overridden (bug in beta2)
  • Enforce build ordering so we don't get error saying web project did not build which is one of the errors issue #73 Code generation fail for WPF if xaml references local types
    • You will se a new project reference "OpenRiaServices Server Project Link" in projects with the code genereation enabled.
  • Automatically generate WebContext for .exe projects
  • Use msbuild property OpenRiaGenerateApplicationContext to control webcontext generation instead of just using SilverlightApplication variable
  • Fix #91 Difference in validation behaviour between Silverlight and .net
    • Desktop version now uses same validation logic as Silverlight build
  • ApplicationServices classes are moved to the Client assembly
    • This means that portable libraries and windows apps can now access them and have AuthenticationServices generated
  • All project now compiles
  • Appveyour compatibility - all projects now builds successfully on ci.appveyor.com


Beta2: (2016-02-16)

Beta1: (2016-02-07)

DomainClientFactory

The communication layer on the client can now be easily switched, for an example implementation se https://github.com/Daniel-Svensson/OpenRiaPlayground/tree/master/HttpClient

PR: https://openriaservices.codeplex.com/SourceControl/network/forks/danneesset/openriaservices/contribution/8505

What:
  • Introduces a new extension point for controlling what kind of DomainClient gets created and how.
  • Allow Desktop and Portable clients to specify a "Base uri" so that the default constructor generated by the code gen can work outside silverlight.

This should hopefully remove the last strong dependency from the "core" Client on the current WCF based Client.Web assembly so that it becomes possible to add new service communication
protocols in the future.

Why?
  • Make the core assembly independent of how we communicate with the Server.
  • Allow new communication protocols in the future such as talking to the DomainController odata service, (soap/json endpoints) etc as well as for providing a portable alternative for the current Client.Web assembly for talking with normal DomainServices.

How to use it:
  • Most user don't do anything at all, it will setup a DomainClientFactory automatically
  • For "advanced" scenarios the user can set DomainClient.DomainServiceFactory to a WebDomainClientFactory instance.

Ex: One can add the following code att application startup (ex: App ctor) before WebContext or any other DomainContext get created

```
DomainContext.DomainClientFactory = new WebDomainClientFactory()
{
ServerBaseUri = new Uri("http://localhost:51359/ClientBin/", UriKind.Absolute),
};
```

For another example with both Silverlight, WPF and Windows 8 app see https://github.com/Daniel-Svensson/OpenRiaPlayground/tree/master/HttpClient (WIn8 upp is not updater to beta1)

Source code checked in, #2ea5b54b27f7497d25b81adc780be070bf91b709

$
0
0
Dont include content files from server project link

Created Unassigned: 4.5.0-rc2 - import Project="..\packages\OpenRiaservices.Client.CodeGen.." [97]

$
0
0
After upgrading my solution to 4.5.0-rc2 (from 4.4.1), I could not open my Silverlight client anymore, complaining I could only reference other Silverlight projects.

I noticed these lines were added to my Silverlight .proj:
```
<Import Project="..\packages\OpenRiaServices.Client.CodeGen.4.5.0-rc2\build\OpenRiaServices.Client.CodeGen.targets" Condition="Exists('..\packages\OpenRiaServices.Client.CodeGen.4.5.0-rc2\build\OpenRiaServices.Client.CodeGen.targets')" />
<Import Project="..\packages\OpenRiaServices.Silverlight.CodeGen.4.5.0-rc2\build\OpenRiaServices.Silverlight.CodeGen.targets" Condition="Exists('..\packages\OpenRiaServices.Silverlight.CodeGen.4.5.0-rc2\build\OpenRiaServices.Silverlight.CodeGen.targets')" />
```
deleting the first import allowed the project to open.

Created Unassigned: FileLoadException - Could not load file or assembly 'OpenRiaServices.DomainServices.Client.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies [98]

$
0
0
The commit: ddcb0ea2 made by danneesset <daniel.svensson@hotmail.se>at 8/12/2016 12:54:52 PM introduced FileLoadException in Silverlight version of OpenRiaServices.DomainServices.Client. The root cause is the change of AssemblyVersion to 4.0.0.0 (from 2.0.5.0). In the effect most probably the following code fails:

OpenRiaServices.DomainServices.Client.Data.DefaultDomainClientFactory:

```
/// <summary>
/// Initializes a new instance of the <see cref="DefaultDomainClientFactory"/> class.
/// </summary>
public DefaultDomainClientFactory()
{
// Look for the WebDomainClient in an assembly with the same version and with same signing key as this assembly
var webDomainClientName = "OpenRiaServices.DomainServices.Client.WebDomainClient`1, "
+ TypeUtility.GetAssembly(typeof(DomainClient)).FullName.Replace("OpenRiaServices.DomainServices.Client", "OpenRiaServices.DomainServices.Client.Web");
_webDomainClientType = Type.GetType(webDomainClientName); // Exception here
}
```

The full stack trace is in here:

Unhandled exception at line 58, column 13 in http://localhost:20172/

0x800a139e - JavaScript runtime error: Unhandled Error in Silverlight Application

Code: 4004

Category: ManagedRuntimeError

Message: Microsoft.Practices.ServiceLocation.ActivationException: Activation error occurred while trying to get instance of type ILoggingManager, key "" ---> Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = "VTS.Core.Logging.ILoggingManager", name = "(none)".

Exception occurred while: Calling constructor VTS.Core.Web.Services.LoggingContext().

Exception is: FileLoadException - Could not load file or assembly 'OpenRiaServices.DomainServices.Client.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest. (Exception from HRESULT: 0x80131053)

-----------------------------------------------

At the time of the exception, the container was:



Resolving VTS.Core.Logging.LoggingManager,(none) (mapped from VTS.Core.Logging.ILoggingManager, (none))

Resolving parameter "loggingContext" of constructor VTS.Core.Logging.LoggingManager(VTS.Core.Services.ILoggingContext loggingContext, VTS.Core.Mvvm.IDialogService dialogService)

Resolving VTS.Core.Web.Services.LoggingContext,(none) (mapped from VTS.Core.Services.ILoggingContext, (none))

Calling constructor VTS.Core.Web.Services.LoggingContext()

---> System.IO.FileLoadException: Could not load file or assembly 'OpenRiaServices.DomainServices.Client.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest. (Exception from HRESULT: 0x80131053)

at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)

at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)

at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)

at System.Type.GetType(String typeName)

at OpenRiaServices.DomainServices.Client.DomainContext.CreateDomainClientFactory()

at OpenRiaServices.DomainServices.Client.DomainContext.get_DomainClientFactory()

at OpenRiaServices.DomainServices.Client.DomainContext.CreateDomainClient(Type serviceContract, Uri serviceUri, Boolean usesHttps)

at VTS.Core.Web.Services.LoggingContext..ctor(Uri serviceUri)

at VTS.Core.Web.Services.LoggingContext..ctor()

at BuildUp_VTS.Core.Web.Services.LoggingContext(IBuilderContext )

at Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context)

at Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context)

at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)

at Microsoft.Practices.ObjectBuilder2.BuilderContext.NewBuildUp(NamedTypeBuildKey newBuildKey)

at Microsoft.Practices.Unity.ObjectBuilder.NamedTypeDependencyResolverPolicy.Resolve(IBuilderContext context)

at BuildUp_VTS.Core.Logging.LoggingManager(IBuilderContext )

at Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context)

at Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context)

at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)

at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)

--- End of inner exception stack trace ---

at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)

at Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides)

at Microsoft.Practices.Unity.UnityServiceLocator.DoGetInstance(Type serviceType, String key)

at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)

--- End of inner exception stack trace ---

at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)

at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService]()

at VTS.AM.App.Application_UnhandledException(Object sender, ApplicationUnhandledExceptionEventArgs e)

at MS.Internal.Error.CallApplicationUEHandler(Exception e)

at MS.Internal.Error.GetXresultForUserException(Exception ex)

Commented Unassigned: FileLoadException - Could not load file or assembly 'OpenRiaServices.DomainServices.Client.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies [98]

$
0
0
The commit: ddcb0ea2 made by danneesset <daniel.svensson@hotmail.se>at 8/12/2016 12:54:52 PM introduced FileLoadException in Silverlight version of OpenRiaServices.DomainServices.Client. The root cause is the change of AssemblyVersion to 4.0.0.0 (from 2.0.5.0). In the effect most probably the following code fails:

OpenRiaServices.DomainServices.Client.Data.DefaultDomainClientFactory:

```
/// <summary>
/// Initializes a new instance of the <see cref="DefaultDomainClientFactory"/> class.
/// </summary>
public DefaultDomainClientFactory()
{
// Look for the WebDomainClient in an assembly with the same version and with same signing key as this assembly
var webDomainClientName = "OpenRiaServices.DomainServices.Client.WebDomainClient`1, "
+ TypeUtility.GetAssembly(typeof(DomainClient)).FullName.Replace("OpenRiaServices.DomainServices.Client", "OpenRiaServices.DomainServices.Client.Web");
_webDomainClientType = Type.GetType(webDomainClientName); // Exception here
}
```

The full stack trace is in here:

Unhandled exception at line 58, column 13 in http://localhost:20172/

0x800a139e - JavaScript runtime error: Unhandled Error in Silverlight Application

Code: 4004

Category: ManagedRuntimeError

Message: Microsoft.Practices.ServiceLocation.ActivationException: Activation error occurred while trying to get instance of type ILoggingManager, key "" ---> Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = "VTS.Core.Logging.ILoggingManager", name = "(none)".

Exception occurred while: Calling constructor VTS.Core.Web.Services.LoggingContext().

Exception is: FileLoadException - Could not load file or assembly 'OpenRiaServices.DomainServices.Client.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest. (Exception from HRESULT: 0x80131053)

-----------------------------------------------

At the time of the exception, the container was:



Resolving VTS.Core.Logging.LoggingManager,(none) (mapped from VTS.Core.Logging.ILoggingManager, (none))

Resolving parameter "loggingContext" of constructor VTS.Core.Logging.LoggingManager(VTS.Core.Services.ILoggingContext loggingContext, VTS.Core.Mvvm.IDialogService dialogService)

Resolving VTS.Core.Web.Services.LoggingContext,(none) (mapped from VTS.Core.Services.ILoggingContext, (none))

Calling constructor VTS.Core.Web.Services.LoggingContext()

---> System.IO.FileLoadException: Could not load file or assembly 'OpenRiaServices.DomainServices.Client.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest. (Exception from HRESULT: 0x80131053)

at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)

at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)

at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)

at System.Type.GetType(String typeName)

at OpenRiaServices.DomainServices.Client.DomainContext.CreateDomainClientFactory()

at OpenRiaServices.DomainServices.Client.DomainContext.get_DomainClientFactory()

at OpenRiaServices.DomainServices.Client.DomainContext.CreateDomainClient(Type serviceContract, Uri serviceUri, Boolean usesHttps)

at VTS.Core.Web.Services.LoggingContext..ctor(Uri serviceUri)

at VTS.Core.Web.Services.LoggingContext..ctor()

at BuildUp_VTS.Core.Web.Services.LoggingContext(IBuilderContext )

at Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context)

at Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context)

at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)

at Microsoft.Practices.ObjectBuilder2.BuilderContext.NewBuildUp(NamedTypeBuildKey newBuildKey)

at Microsoft.Practices.Unity.ObjectBuilder.NamedTypeDependencyResolverPolicy.Resolve(IBuilderContext context)

at BuildUp_VTS.Core.Logging.LoggingManager(IBuilderContext )

at Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context)

at Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context)

at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)

at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)

--- End of inner exception stack trace ---

at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)

at Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides)

at Microsoft.Practices.Unity.UnityServiceLocator.DoGetInstance(Type serviceType, String key)

at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)

--- End of inner exception stack trace ---

at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)

at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService]()

at VTS.AM.App.Application_UnhandledException(Object sender, ApplicationUnhandledExceptionEventArgs e)

at MS.Internal.Error.CallApplicationUEHandler(Exception e)

at MS.Internal.Error.GetXresultForUserException(Exception ex)
Comments: If anyone needs workaround, you can implement on your own custom DomainClientFactory and set it in DomainContext. ``` using System; using OpenRiaServices.DomainServices.Client; namespace VTS.Core.Services { /// <summary> /// This is temporary solution to avoid: /// FileLoadException - Could not load file or assembly 'OpenRiaServices.DomainServices.Client.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies /// </summary> /// <remarks> /// Issue is described here: https://openriaservices.codeplex.com/workitem/98 /// </remarks> public sealed class CustomDomainClientFactory : DomainClientFactory { private readonly Type _webDomainClientType = typeof(WebDomainClient<>); /// <summary> /// Creates a WebDomainClient{serviceContract} using reflection. /// </summary> protected override DomainClient CreateDomainClientCore(Type serviceContract, Uri serviceUri, bool requiresSecureEndpoint) { // Try to create a WebDomainClient using reflection if (_webDomainClientType != null) { var domainClientType = _webDomainClientType.MakeGenericType(serviceContract); if (domainClientType == null) { throw new InvalidOperationException("Faild to construct generic WebDomainClient"); } return (DomainClient)Activator.CreateInstance(domainClientType, serviceUri, requiresSecureEndpoint); } throw new InvalidOperationException("You must reference the assembly 'OpenRiaServices.DomainServices.Client.Web'"); } } } ``` App.xaml.cs ``` public App() { // TEMP: This is bug fix for issue reported by me: https://openriaservices.codeplex.com/workitem/98 OpenRiaServices.DomainServices.Client.DomainContext.DomainClientFactory = new Core.Services.CustomDomainClientFactory(); // TEMP: END ```
Viewing all 124 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>