错误Visual Studio生成失败 - allowDefinition ='MachineToApplication' [英] Error Visual Studio Build Failed - allowDefinition='MachineToApplication'

查看:94
本文介绍了错误Visual Studio生成失败 - allowDefinition ='MachineToApplication'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我对"Visual Studio Build"的构建定义有疑问步。我想获得并配置"文件系统"部署,只需将文件系统文件等工件文件准备好发布到QA。



好​​的,我的Visual Studio Build步骤按照以下步骤配置:



    1.解决方案:绑定到解决方案文件。

Hello everyone,

I have a problem with build definition on "Visual Studio Build" step. I want to get and configure "File System" Deployment and just get the artifact files like file system files ready for release to QA.

Ok, my Visual Studio Build step is configured on follow steps:

   1.Solution: Binded to the solution file.

    2。 MsBuild参数:/ p:DeployOnBuild = True / p:DeployDefaultTarget = WebPublish / p:WebPublishMethod = FileSystem / p:DeleteExistingFiles = True / p:publishUrl = $(build.artifactstagingdirectory)\ for-deploy\website

   2. MsBuild Arguments: /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:DeleteExistingFiles=True /p:publishUrl=$(build.artifactstagingdirectory)\for-deploy\website

    3.配置:$(BuildConfiguration)= Release

    3. Configuration: $(BuildConfiguration) = Release

当解决方案在构建过程中时,我收到错误消息:



ApplicationName.Web \obj \ release \ aspnetcompilemerge\source \web.config(44,0)
$
使用注册为allowDefinition ='MachineToApplication'的部分是错误的超出应用水平。这个错误可能是因为虚拟目录未被配置为IIS中的应用程序。



好​​的,我在google搜索并找到有关为应用程序创建虚拟目录的一些建议,但是如何创建一个我还没有的虚拟目录。



有人建议删除obj和bin文件,好吧,我在网上添加了下一行。构建之前的csproj删除obj和bin文件:



< Target Name =" BeforeBuild">

  &NBSP; <! - 删除obj文件夹 - >

  &NBSP; < RemoveDir Directories =" $(BaseIntermediateOutputPath)" />

  &NBSP; <! - 删除bin文件夹 - >

  &NBSP; < RemoveDir Directories =" $(BaseOutputPath)" />
$
< / Target>



没有帮助。 :( 
$


最后,最令人困惑的是。在工件(a)文件夹中,在TFS服务器上,在_work中构建失败进程后


文件夹我得到正确的文件准备部署,就像我期望的那样,但是&bbsp


build has处于失败状态。 
$


我真的希望,有人有类似问题。如果有人想要我可以复制日志。



谢谢你,
Ratomir Vukadin



$






$

When the solution is under the building process, I get the error message:

ApplicationName.Web\obj\release\aspnetcompilemerge\source\web.config (44, 0)
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.

Ok, I was googling and find some suggestions about creating virtual directory for the application, but how to create a virtual directory I don't have it yet.

Some suggest to delete obj and bin files, ok, I added next lines to web.csproj before build to remove obj and bin files:

<Target Name="BeforeBuild">
    <!-- Remove obj folder -->
    <RemoveDir Directories="$(BaseIntermediateOutputPath)" />
    <!-- Remove bin folder -->
    <RemoveDir Directories="$(BaseOutputPath)" />
</Target>

Didn't help. :( 

And on the end, what is most confusing. In the artifacts (a) folder, on the TFS server, in the _work

folder after Build failed process I get the correct files ready for deployment, like I expecting, but 

build has in the failed status. 

I really hope, that somebody has similar issues. If some want I can copy the logs.

Thank You,
Ratomir Vukadin






推荐答案

您好Ratomir,

Hi Ratomir,

如果您在构建服务器上手动发布它会得到什么结果?如果您尝试使用新项目会得到什么结果?您能分享吗? OneDrive上的一个简单项目?

What’s the result if you publish it manually on build server? What’s the result if you try it with a new project? Can you share a simple project on the OneDrive?

问候

Starain


这篇关于错误Visual Studio生成失败 - allowDefinition ='MachineToApplication'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆