SmartAssembly build failed. Type initializer threw exception
KirillSk
Posts: 3
Hi, I am using SmartAssembly 6.1 in my build tasks.
Here is fragment of my .csproj file.
SmartAssembly build failed: The type initializer for 'SmartAssembly.ConsoleApp' threw an exception.
At the same time if I launch SmartAssembly application, create new project and build it, build succeeds. What could be wrong?
Here is fragment of my .csproj file.
<UsingTask TaskName="SmartAssembly.MSBuild.Tasks.Build" AssemblyName="SmartAssembly.MSBuild.Tasks, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7f465a1c156d4d57" /> <Target Name="BeforeBuild"> <CreateItem Include="$(ProjectDir)\**\*.*.resx"> <Output TaskParameter="Include" ItemName="EmbeddedResource" /> </CreateItem> </Target> <Target Name="AfterBuild" Condition=" '$(Configuration)' == 'Release' AND '$(Obfuscate)' == 'Yes' "> <SmartAssembly.MSBuild.Tasks.Build ProjectFile="CoreDomain.saproj" MarkAsReleased="True" /> </Target>I get following error when start building:
SmartAssembly build failed: The type initializer for 'SmartAssembly.ConsoleApp' threw an exception.
At the same time if I launch SmartAssembly application, create new project and build it, build succeeds. What could be wrong?
Comments
The only way I've found around that is to not use the MSBUILD task DLL and change the post-build action to an EXEC task instead.