PCLStorage icon indicating copy to clipboard operation
PCLStorage copied to clipboard

System.MemberAccessException due to AssemblyCompany not set in AssemblyInfo.cs

Open jaderfeijo opened this issue 8 years ago • 1 comments

While trying to check whether or not a folder exists from a PCL library through a Unit Test target via SpecialFolder.Current.Cache.CheckExistsAsync("MyFolder") I get the following exception being thrown, which cases my unit test to fail:

System.MemberAccessException : There is a need to set a valid value to AssemblyCompany of AssemblyInfo.cs.

Stack trace:

  at PCLStorage.FolderPathImplementation.get_CompanyName () [0x00026] in <8863a90a3bb844dc851b55584719db5c>:0 
  at PCLStorage.FolderPathImplementation.GetPath (System.Environment+SpecialFolder specialFolder, System.String subFolder) [0x00011] in <8863a90a3bb844dc851b55584719db5c>:0 
  at PCLStorage.FolderPathImplementation.get_Cache () [0x00000] in <8863a90a3bb844dc851b55584719db5c>:0 
  at PCLStorage.SpecialFolderImplementation+<>c.<.ctor>b__28_4 () [0x00005] in <350c568532c8492b932e1f1f3b4a07fa>:0 
  at System.Lazy`1[T].CreateValue () [0x00075] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/Lazy.cs:437 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357 
  at DrinkUpLondon.Services.Rest.Tests.FileCacheProviderTests+<TestCaching>c__async0.MoveNext () [0x000fa] in /Users/jaderfeijo/Dropbox (Personal)/Development/Xamarin/drinkuplondon/DrinkUpLondon.Tests/Sources/Tests/Services/Rest/FileCacheProviderTests.cs:25 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
  at NUnit.Framework.Internal.ExceptionHelper.Rethrow (System.Exception exception) [0x00006] in <a136915bdafc4f7db46d0b0a906d5367>:0 
  at NUnit.Framework.Internal.AsyncInvocationRegion+AsyncTaskInvocationRegion.WaitForPendingOperationsToComplete (System.Object invocationResult) [0x00030] in <a136915bdafc4f7db46d0b0a906d5367>:0 
  at NUnit.Framework.Internal.Commands.TestMethodCommand.RunAsyncTestMethod (NUnit.Framework.Internal.TestExecutionContext context) [0x00038] in <a136915bdafc4f7db46d0b0a906d5367>:0 

jaderfeijo avatar Apr 18 '17 13:04 jaderfeijo

I just ran into this as well while NUnit testing. Error happens at PCLStorage.FolderPathImplementation.get_CompanyName(). Since all my AssemblyInfo's have a company name, it must be the NUnit object that somehow needs to get the label. ;P Any tips much appreciated.

======= Failed test run #1 ==========
System.AggregateException : One or more errors occurred.
  ----> System.MemberAccessException : There is a need to set a valid value to AssemblyCompany of AssemblyInfo.cs.
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Kumquat.Dict.SQL.SQLiteDict..ctor(String dbPath, String datDir) in C:\TeamCity\buildAgent\work\7362d39d6f4ffc33\src\Dict\Kumquat.Dict\SQL\SQLiteDict.cs:line 77
   at Kumquat.Dict.Tests.DbDict..ctor() in C:\TeamCity\buildAgent\work\7362d39d6f4ffc33\src\Dict\Kumquat.Dict.Tests\DbDict.cs:line 13
   at Kumquat.Dict.Tests.DbDictTest.<GenerateDbDict>d__4.MoveNext() in C:\TeamCity\buildAgent\work\7362d39d6f4ffc33\src\Dict\Kumquat.Dict.Tests\DbDictTest.cs:line 45
--- End of stack trace from previous location where exception was thrown ---
   at NUnit.Framework.Internal.ExceptionHelper.Rethrow(Exception exception)
   at NUnit.Framework.Internal.AsyncInvocationRegion.AsyncTaskInvocationRegion.WaitForPendingOperationsToComplete(Object invocationResult)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.RunAsyncTestMethod(TestExecutionContext context)
--MemberAccessException
   at PCLStorage.FolderPathImplementation.get_CompanyName()
   at PCLStorage.FolderPathImplementation.GetPath(SpecialFolder specialFolder, String subFolder)
   at PCLStorage.SpecialFolderImplementation.<>c.<.ctor>b__28_1()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at Kumquat.Common.IOUtils.get_CurrentLocal() in C:\TeamCity\buildAgent\work\7362d39d6f4ffc33\src\Common\Kumquat.Common\IO\IOUtils.cs:line 202
   at Kumquat.Common.IOUtils.<GetDataFolder>d__12.MoveNext() in C:\TeamCity\buildAgent\work\7362d39d6f4ffc33\src\Common\Kumquat.Common\IO\IOUtils.cs:line 226
======= Failed test run #2 ==========
System.AggregateException : One or more errors occurred.
  ----> System.MemberAccessException : There is a need to set a valid value to AssemblyCompany of AssemblyInfo.cs.
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Kumquat.Dict.SQL.SQLiteDict..ctor(String dbPath, String datDir) in C:\TeamCity\buildAgent\work\7362d39d6f4ffc33\src\Dict\Kumquat.Dict\SQL\SQLiteDict.cs:line 77
   at Kumquat.Dict.Tests.DbDict..ctor() in C:\TeamCity\buildAgent\work\7362d39d6f4ffc33\src\Dict\Kumquat.Dict.Tests\DbDict.cs:line 13
   at Kumquat.Dict.Tests.DbDictTest.<GenerateDbDict>d__4.MoveNext() in C:\TeamCity\buildAgent\work\7362d39d6f4ffc33\src\Dict\Kumquat.Dict.Tests\DbDictTest.cs:line 45
--- End of stack trace from previous location where exception was thrown ---
   at NUnit.Framework.Internal.ExceptionHelper.Rethrow(Exception exception)
   at NUnit.Framework.Internal.AsyncInvocationRegion.AsyncTaskInvocationRegion.WaitForPendingOperationsToComplete(Object invocationResult)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.RunAsyncTestMethod(TestExecutionContext context)
--MemberAccessException
   at PCLStorage.FolderPathImplementation.get_CompanyName()
   at PCLStorage.FolderPathImplementation.GetPath(SpecialFolder specialFolder, String subFolder)
   at PCLStorage.SpecialFolderImplementation.<>c.<.ctor>b__28_1()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at Kumquat.Common.IOUtils.get_CurrentLocal() in C:\TeamCity\buildAgent\work\7362d39d6f4ffc33\src\Common\Kumquat.Common\IO\IOUtils.cs:line 202
   at Kumquat.Common.IOUtils.<GetDataFolder>d__12.MoveNext() in C:\TeamCity\buildAgent\work\7362d39d6f4ffc33\src\Common\Kumquat.Common\IO\IOUtils.cs:line 226

tofutim avatar May 04 '17 06:05 tofutim