0

I'm using tfs 2015.3 and I'm trying to compile a web service project (.asmx).

Now, my build failed because of this error: It is an error to user asection registered as allowDefinition='MachineToApplication' beyond application level

I looked online for solutions and found that there is a problem at the build when 2 web.config is at the same project (one at the root and one is somewhere at the project's folders). Then I saw that a folder named PrecompileWeb was created with content of another project from the solution.

I tried to build the project at vs2013/2015 and the folder does not get created, as opposed to with msbuild (which tfs probably uses).

How can I prevent this folder from appearing? I saw a solution that suggested giving a property of '/p:PreBuildEvent=' or something like that, but it's not working.

vich
  • 11,836
  • 13
  • 49
  • 66
Elad Motola
  • 45
  • 10
  • What msbuild parameters you add in TFS Visual Studio Build task? To prevent the `PrecompileWeb`, you could refer to this link: http://stackoverflow.com/questions/43805055/publish-artifacts-for-website-goes-to-precompiledweb/43841775#43841775 – Tingting0929 May 09 '17 at 08:47
  • The params are platform:any CPU and configuration:release. Right now I'm not using deploy, so I don't know if the link is helping me – Elad Motola May 09 '17 at 08:59
  • Without some other msbuild parameters? – Tingting0929 May 09 '17 at 09:00
  • I just edit my command, sorry – Elad Motola May 09 '17 at 09:00
  • @Tingting0929-MSFT i saw the link again and i dont understand why adding /p:VisualStudioVersion=14.0 is the solution – Elad Motola May 09 '17 at 16:52
  • Sorry that I didn't find what you edited. And the key point of link is to build the `website.publishproj`file not the `***.sln` file. – Tingting0929 May 10 '17 at 01:43
  • Did you succeed to prevent the 'Precompileweb' to generate? Does the error still exists? – Tingting0929 May 11 '17 at 11:42
  • @Tingting09292-MSFT It works! Thank you very much. But my tfs build is still not working, I think it's because my lack of knowledge working with publish – Elad Motola May 12 '17 at 06:05
  • You'd better give me a screenshot of your Visual Studio Build Tasks and what values you put for the parameters. – Tingting0929 May 15 '17 at 01:11

0 Answers0