Tôi đang sử dụng visual studio 2012 khi tôi cố gắng để xuất bản ứng dụng web của tôi, tôi nhận được lỗi sau:Đây là một lỗi sử dụng một phần đăng ký là allowDefinition = 'MachineToApplication'
Error 1 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. E:\Temp\BUILD\Debug\AspnetCompileMerge\Source\bin\web.config 24 0 Pixelate
Dưới đây là nội dung của cửa sổ đầu ra:
1>------ Build started: Project: Pixelate, Configuration: Debug Any CPU ------
1> No way to resolve conflict between "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes" and "System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes" arbitrarily.
1> No way to resolve conflict between "System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "System.ServiceModel.Web, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" arbitrarily.
1> Pixelate -> [...]\bin\TwistedPixel.Pixelate.dll
1> '[...]\bin'
1> CMD.EXE was started with the above path as the current directory.
1> UNC paths are not supported. Defaulting to Windows directory.
2>------ Publish started: Project: Pixelate, Configuration: Debug Any CPU ------
2>Connecting to [...]...
2>Transformed Web.config using [...]\Web.Debug.config into E:\Temp\BUILD\Debug\TransformWebConfig\transformed\Web.config.
2>Transformed[...]\Web.config using [...]\bin\Web.Debug.config into E:\Temp\BUILD\Debug\TransformWebConfig\transformed\bin\Web.config.
2>Copying all files to temporary location below for package/publish:
2>E:\Temp\BUILD\Debug\AspnetCompileMerge\Source.
2>C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v/-p E:\Temp\BUILD\Debug\AspnetCompileMerge\Source -c -d E:\Temp\BUILD\Debug\AspnetCompileMerge\TempBuildDir
2>E:\Temp\BUILD\Debug\AspnetCompileMerge\Source\bin\web.config(24,0): Error ASPCONFIG: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
2>
========== Build: 1 succeeded, 0 failed, 2 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
Nếu ai đó có thể giải thích tại sao điều này xảy ra và cách khắc phục, điều đó thật tuyệt.
Tôi đã thử làm sạch và xây dựng lại (nó xây dựng lại tốt) Tôi đã thử xóa thùng rác, obj và đã di chuyển thư mục đầu ra tạm thời - vẫn còn lỗi vẫn tồn tại.
Có thể trùng lặp lỗi [allowDefinition = 'MachineToApplication' khi xuất bản từ VS2010 (nhưng chỉ sau lần xây dựng trước đó)] (http://stackoverflow.com/questions/2566215/allowdefinition-machinetoapplication-error-when-publishing-from -vs2010-nhưng-on) – JotaBe