Showing posts with label visual studio 2010. Show all posts
Showing posts with label visual studio 2010. Show all posts

Friday, 27 July 2012

Visual Studio C# web application build fails with "Error 46"

After rebuild I've got following error:

"Error 46 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. ..."

Clear build and rebuild didn't help. Deleting all files in Bin folder did help! :)

When you are sick of deleting bin folder, just simple add folowing tag to *.csproj:


<Target Name="AfterBuild" Condition="'$(Configuration)'=='Release'">
  <RemoveDir Directories="$(IntermediateOutputPath)" />
</Target>


Source:
http://stackoverflow.com/questions/7388359/mvc3-project-build-fails-because-of-web-config-in-obj-folder
Enhanced by Zemanta

Thursday, 19 July 2012

Enable .config file build configuration transformations in non-web based applications

Not posible OutOfTheBox in Visual Studio 2010 and not in current Visual Studio 12 RC, but it exists an easy work around in David Sandor blog post.