5

there are a ton of SO postings on this subject. by far, the solution seems to be to configure the directory in IIS as an application. Another common solution is to remove backup web.config files from folders in the root.

my problem is different because I'm running on IIS Express so there's no way to configure the folder as an application. what I've noticed is that every time I compile, there's a folder called obj in my root which causes the problem. So I have to manually remove it, every time.

@Valamas, in this post indicates he just scripted the removal of that folder but I'm thinking there's got to be a better way... the error occurs for me on this line:

<authentication mode="Forms">

but seems to occur in other instances. ideas anyone?

Community
  • 1
  • 1
ekkis
  • 9,804
  • 13
  • 55
  • 105
  • Far from being an elegant solution... as a stop gap, add to PostBuild event command line: `rd "$(ProjectDir)obj" /q /s`. In my test, it did not remove the folder or subfolders but did remove the files. – Valamas Aug 08 '11 at 22:04
  • 5
    `rd "$(ProjectDir)obj" /q /s` (here is the command again on a single line) – Valamas Aug 08 '11 at 22:05
  • thanks for the actual code :) – ekkis Aug 09 '11 at 00:28
  • I still hope there's a better answer though. there must be a reason for this – ekkis Aug 09 '11 at 00:29

1 Answers1

1

You probably built the project under 'Release' and then reverted to 'Debug'. You should switch to 'Release' and perform Clean Solution: section registered as allowDefinition='MachineToApplication' beyond application level

Community
  • 1
  • 1
Ofer Zelig
  • 17,068
  • 9
  • 59
  • 93
  • 1
    I've never used the **Release**, only **Debug**. In fact, the problem doesn't seem to happen when I just build. it happens when I go to publish (which requires a build)... – ekkis Aug 08 '11 at 22:18