[jira] [Commented] (AVRO-1981) ReflectionTypeLoadException

2019-03-01 Thread Hudson (JIRA)


[ 
https://issues.apache.org/jira/browse/AVRO-1981?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16782116#comment-16782116
 ] 

Hudson commented on AVRO-1981:
--

SUCCESS: Integrated in Jenkins build AvroJava #609 (See 
[https://builds.apache.org/job/AvroJava/609/])
AVRO-1981: Catch exceptions loading types from assemblies in C# (dan: 
[https://github.com/apache/avro/commit/846a9a1bb85e9832b696970c96e6089d43c3ee6b])
* (edit) lang/csharp/src/apache/main/Specific/ObjectCreator.cs


> ReflectionTypeLoadException
> ---
>
> Key: AVRO-1981
> URL: https://issues.apache.org/jira/browse/AVRO-1981
> Project: Apache Avro
>  Issue Type: Bug
>  Components: csharp
>Affects Versions: 1.8.2
>Reporter: Josh Steward
>Assignee: Brian Lachniet
>Priority: Minor
> Fix For: 1.9.0
>
>
> In the ObjectCreator the call to FindType(name, throwError) can throw a 
> ReflectionTypeLoadException during the call to assembly.GetTypes() if any of 
> the types are not able to load, MSDN link below for ref. This effectively 
> kills the entire deserialization process. I put in a simple workaround to 
> just continue if this happens. In my particular case it was trying to load 
> types from a devexpress test runner dll.
> https://msdn.microsoft.com/en-us/library/system.reflection.assembly.gettypes(v=vs.110).aspx
> private Type FindType(string name,bool throwError)
> {
> //other code
> foreach (Assembly assembly in assemblies)
> {
> // Fix for Mono 3.0.10
> if (assembly.FullName.StartsWith("MonoDevelop.NUnit"))
> continue;
> /*Added catch in case assembly contains unloadable 
> types*/ 
> try 
> {
> types = assembly.GetTypes();
> } 
> catch (ReflectionTypeLoadException ex)
> {
> continue;
> }
> //other code
> }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AVRO-1981) ReflectionTypeLoadException

2019-03-01 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/AVRO-1981?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16782050#comment-16782050
 ] 

ASF subversion and git services commented on AVRO-1981:
---

Commit 846a9a1bb85e9832b696970c96e6089d43c3ee6b in avro's branch 
refs/heads/master from Brian Lachniet
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=846a9a1 ]

AVRO-1981: Catch exceptions loading types from assemblies in C#

Loading all types from all assemblies in the current domain
could throw an exception for a variety of non-fatal reasons.
Simply catch these exceptions and continue.


> ReflectionTypeLoadException
> ---
>
> Key: AVRO-1981
> URL: https://issues.apache.org/jira/browse/AVRO-1981
> Project: Apache Avro
>  Issue Type: Bug
>  Components: csharp
>Affects Versions: 1.8.2
>Reporter: Josh Steward
>Assignee: Brian Lachniet
>Priority: Minor
> Fix For: 1.9.0
>
>
> In the ObjectCreator the call to FindType(name, throwError) can throw a 
> ReflectionTypeLoadException during the call to assembly.GetTypes() if any of 
> the types are not able to load, MSDN link below for ref. This effectively 
> kills the entire deserialization process. I put in a simple workaround to 
> just continue if this happens. In my particular case it was trying to load 
> types from a devexpress test runner dll.
> https://msdn.microsoft.com/en-us/library/system.reflection.assembly.gettypes(v=vs.110).aspx
> private Type FindType(string name,bool throwError)
> {
> //other code
> foreach (Assembly assembly in assemblies)
> {
> // Fix for Mono 3.0.10
> if (assembly.FullName.StartsWith("MonoDevelop.NUnit"))
> continue;
> /*Added catch in case assembly contains unloadable 
> types*/ 
> try 
> {
> types = assembly.GetTypes();
> } 
> catch (ReflectionTypeLoadException ex)
> {
> continue;
> }
> //other code
> }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AVRO-1981) ReflectionTypeLoadException

2017-10-31 Thread JIRA

[ 
https://issues.apache.org/jira/browse/AVRO-1981?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16226449#comment-16226449
 ] 

Arturo Candela Moltó commented on AVRO-1981:


As [~JSteward] reoported, There are problems when the Avro generated c# classes 
are in another dll Library instead of beeing in the ".exe" project.

My group is currently developing a project that includes a lot of shared 
objects and I'm developing a Project Library (dll) that includes all the 
generated objects between all the applications.

The problem that I'm having with this model is that a nested object cannot be 
deserialized because It fails. If the object is simple, It can be deserialized 
without problems. But if I put the generated objects in the ".exe" Project, it 
works as expected.

I'm going to look if I'm able to pass to avro in which dll are the object 
definitions so avro will be able to deserialize the objects. I find something I 
will add to this bug.

Regard.

> ReflectionTypeLoadException
> ---
>
> Key: AVRO-1981
> URL: https://issues.apache.org/jira/browse/AVRO-1981
> Project: Avro
>  Issue Type: Bug
>  Components: csharp
>Reporter: Josh Steward
>Priority: Minor
>
> In the ObjectCreator the call to FindType(name, throwError) can throw a 
> ReflectionTypeLoadException during the call to assembly.GetTypes() if any of 
> the types are not able to load, MSDN link below for ref. This effectively 
> kills the entire deserialization process. I put in a simple workaround to 
> just continue if this happens. In my particular case it was trying to load 
> types from a devexpress test runner dll.
> https://msdn.microsoft.com/en-us/library/system.reflection.assembly.gettypes(v=vs.110).aspx
> private Type FindType(string name,bool throwError)
> {
> //other code
> foreach (Assembly assembly in assemblies)
> {
> // Fix for Mono 3.0.10
> if (assembly.FullName.StartsWith("MonoDevelop.NUnit"))
> continue;
> /*Added catch in case assembly contains unloadable 
> types*/ 
> try 
> {
> types = assembly.GetTypes();
> } 
> catch (ReflectionTypeLoadException ex)
> {
> continue;
> }
> //other code
> }



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)