TestActionAttribute
์์ ํ์๋ ์ฌ์ฉ์ ์ง์ ํน์ฑ์ ๋ง๋ ๋ค์ ์ต์ ๋ฒ์ ์ NUnit์ ์ฌ์ฉํ๋ ํ
์คํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์์ ํด๋น ํน์ฑ์ ์ฌ์ฉํ๋ฉด ์ด์ NUnit ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๋ก๋ํ ์ ์๊ธฐ ๋๋ฌธ์ NUnit์ด ํ
์คํธ๋ฅผ ์คํํ์ง ์๊ฒ ๋ฉ๋๋ค. app.config
๋ฅผ ์ฌ์ฉํ์ฌ ์ต์ NUnit ๋ฒ์ ์ผ๋ก ๋ฆฌ๋๋ ์
ํ๋ฉด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋๊ณ ํ
์คํธ๊ฐ ์์๋๋ก ์คํ๋ฉ๋๋ค.
๋ฌธ์ ๋ ์ผ๋ฐ ํ ์คํธ๊ฐ ์คํ๋์ง ์๋ ๊ฒ์ฒ๋ผ ๋ณด์ด๊ธฐ ๋๋ฌธ์ ๋ช ํํ์ง ์์ต๋๋ค(์ํ: ๊ฒฐ๋ก ์์). ์ด๊ฒ์ด NUnit.ApplicationDomain ๋ฌธ์ #25 ์ ์์ธ์ด์์ต๋๋ค
An exception was thrown while loading the test.
System.IO.FileLoadException: Could not load file or assembly 'nunit.framework, Version=3.7.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'nunit.framework, Version=3.7.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb'
at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at NUnit.Framework.Internal.TypeWrapper.GetCustomAttributes[T](Boolean inherit)
at NUnit.Framework.Internal.Builders.DefaultSuiteBuilder.GetFixtureBuilderAttributes(ITypeInfo typeInfo)
at NUnit.Framework.Internal.Builders.DefaultSuiteBuilder.BuildFrom(ITypeInfo typeInfo)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Exception doesn't have a stacktrace
๊ทผ๋ณธ์ ์ธ ๋ฌธ์ - ์์ฑ NUnit๊ณผ ์ด์ ๋ฒ์ ์ ์ฐธ์กฐ๊ฐ - "๊ฒ ์๋-์์ "์ผ๋ก ํ์ ๋ ์ ์์ง๋ง ์ฌ์ฉ์๊ฐ ์ค๋ฅ ๋ฉ์์ง์ ์ผ์ข ์ ๊ฐ์ง๊ณ ํ๋ ๊ฒ์ด ์๋๋ผ ํ ์คํธ๊ฐ ๊ฒ์ผ๋ก ์คํ์ ๊ฑฐ๋ถํ๋ ๊ฒ๋ณด๋ค ์ ์ฉ ํ ์ ์์ต๋๋ค ์๊ฐ .
@ _repo_NUnitAttributesTargettingDifferentVersion์ ํตํด ์ฌ์์ฐ ์๋ฃจ์ ์ ๋ง๋ค์์ต๋๋ค.
๋๋ ๊ฒฐ๋ก ์ ๋์ํฉ๋๋ค. ์ฌ์ฉ์ ์ ์ ์์ฑ์ด ํ์ฅ๋๋ NUnit ๋ฒ์ ์ ์ ๊ฒจ ์๋ค๋ ์ฌ์ค์ ์๋ก์ด ๊ฒ์ด ์๋์ง๋ง ์ฝ๊ฒ ๋ฐ๊ฒฌํ ์ ์์ต๋๋ค. ๋ฌธ์๋ฅผ ๊ฒํ ํ์ฌ ์ด๊ฒ์ด ๋ช ํํ๊ณ ๋ฐฉ๋ฒ์ ์์ ๋ด๋ ค๊ณ ๋ ธ๋ ฅํด์ผ ํฉ๋๋ค. ์ถฉ๋ํ๋ ํ๋ ์์ํฌ ๋ฒ์ ์ ๊ฐ์งํ๊ณ ์ค๋ฅ ๋ฉ์์ง๋ฅผ ์ ๊ณตํฉ๋๋ค.
๋ํ ๊ฐ๋ฅํ ํ ์ด์ ๋ฒ์ ๊ณผ ํธํ๋๋ ์ฌ์ฉ์ ์ง์ ์์ฑ์ ์์ฑํ๋ ๋ฐฉ๋ฒ์ ๋ฌธ์ํํด์ผ ํฉ๋๋ค. ๋ณ๊ฒฝ๋์ง ์๋ ์ธํฐํ์ด์ค์๋ง ์์กดํ๊ณ ๊ตฌ์ฑ ํ์ผ์์ ๋ฐ์ธ๋ฉ ๋ฆฌ๋๋ ์ ์ ์ฌ์ฉํ๋ฉด ํธ๋ฆญ์ ์ํํ ์ ์์ง๋ง ๋๊ตฐ๊ฐ ๋จผ์ ์๋ํด์ผ ํ๋ค๊ณ ์๊ฐํฉ๋๋ค.
๋๋ ์ด๊ฒ์ ๋ ๋ฌธ์๋ก ํ์ํ๊ณ ์์ผ๋ฏ๋ก ์ถฉ๋ ๋ฒ์ ์ ๊ฐ์งํ๊ณ ๋ฐ์ธ๋ฉ ๋ฆฌ๋๋ ์ ์ ๊ถ์ฅํ ์ ์๋๋ก ์ด๋ฅผ ๊ฒํ ํ๊ณ ๊ฐ์ ์ฌํญ์ ๊ฒํ ํ ์ ์์ต๋๋ค.
๋๋ Roslyn์ ๋ํด ์ ๋ชจ๋ฅด์ง๋ง, ์ด๊ฒ์ด ๋ถ์๊ธฐ๊ฐ ๊ฐ์งํ ์ ์๋ ๊ฒ์ ๋๊น? ๋๋ ๋ฐํ์ ๊ฒ์ฌ์ฌ์ผ ํฉ๋๊น(์ค๋ฅ ๋ฉ์์ง ๊ฐ์ )
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋๋ ๊ฒฐ๋ก ์ ๋์ํฉ๋๋ค. ์ฌ์ฉ์ ์ ์ ์์ฑ์ด ํ์ฅ๋๋ NUnit ๋ฒ์ ์ ์ ๊ฒจ ์๋ค๋ ์ฌ์ค์ ์๋ก์ด ๊ฒ์ด ์๋์ง๋ง ์ฝ๊ฒ ๋ฐ๊ฒฌํ ์ ์์ต๋๋ค. ๋ฌธ์๋ฅผ ๊ฒํ ํ์ฌ ์ด๊ฒ์ด ๋ช ํํ๊ณ ๋ฐฉ๋ฒ์ ์์ ๋ด๋ ค๊ณ ๋ ธ๋ ฅํด์ผ ํฉ๋๋ค. ์ถฉ๋ํ๋ ํ๋ ์์ํฌ ๋ฒ์ ์ ๊ฐ์งํ๊ณ ์ค๋ฅ ๋ฉ์์ง๋ฅผ ์ ๊ณตํฉ๋๋ค.
๋ํ ๊ฐ๋ฅํ ํ ์ด์ ๋ฒ์ ๊ณผ ํธํ๋๋ ์ฌ์ฉ์ ์ง์ ์์ฑ์ ์์ฑํ๋ ๋ฐฉ๋ฒ์ ๋ฌธ์ํํด์ผ ํฉ๋๋ค. ๋ณ๊ฒฝ๋์ง ์๋ ์ธํฐํ์ด์ค์๋ง ์์กดํ๊ณ ๊ตฌ์ฑ ํ์ผ์์ ๋ฐ์ธ๋ฉ ๋ฆฌ๋๋ ์ ์ ์ฌ์ฉํ๋ฉด ํธ๋ฆญ์ ์ํํ ์ ์์ง๋ง ๋๊ตฐ๊ฐ ๋จผ์ ์๋ํด์ผ ํ๋ค๊ณ ์๊ฐํฉ๋๋ค.