Solve the problem that the TFS build ASP. net mvc cannot be accessed after mvcbuildviews is opened

Source: Internet
Author: User
ArticleDirectory
    • Activate mvcbuildviews

We willMvcbuildviewsIf this parameter is set to true, but because the company uses msbuild of TFS, it will generate problems due to environmental concerns, such as failure to import components.

 

Activate mvcbuildviews

Start. CsprojThere are usually two methods for opening the case.

    1. Directly use the text recorder to open a notebook (such as NotePad)
    2. After logging in to Solution Explorer, select solution on the rightUnload ProjectAfter the instance is detached, select right-clickEdit *. csproj

 

Original case content

 
<Project...>... <mvcbuildviews> false </mvcbuildviews>... <target name = "afterbuild" condition = "'$ (mvcbuildviews)' = 'true'"> <aspnetcompiler virtualpath = "Temp" physicalpath = "$ (projectdir) "/> </Target>... </Project>

 

After you change mvcbuildviews to <mvcbuildviews> true </mvcbuildviews>, after each build in visual stuiod. aspx or. ascx and other slave cases are also built once to enable early release of zookeeper.

ASP.. Net MVC builds only *. CS ,*. designer. CS, such as controller and model, under other views *. aspx ,*. ascx cannot be built, but in. if aspx is typed, it can be resolved only when the website is being accessed. This problem can be found clearly during the build period, this is much more efficient than a one-to-one online workflow.

However, the same settings are normal on the current machine. However, when using TFs build, there will be a problem that cannot be accessed into the group because of the TFS msbuild settings, the injection and injection are in different addresses, so $ (projectdir) cannot find the bin and Its DLL, in this way, there will be a problem between the current machine and TFs, so we need to addIsdesktopbuild.

 
<Target name = "afterbuild" condition = "'$ (mvcbuildviews)' = 'true'"> <aspnetcompiler condition = "'$ (isdesktopbuild )'! = 'False' "virtualpath =" Temp "physicalpath =" $ (projectdir) "/> <aspnetcompiler condition =" '$ (isw.topbuild) '= 'false' "virtualpath =" Temp "physicalpath =" $ (outdir) \ _ publishedwebsites \ $ (projectname) "/> </Target>

Use Condition = "'$ (isdesktopbuild)' = 'false'" to separate the msbuild of the Local Machine from that of TFS.

TFS msbuild Information Structure

-- [Set the drop folder]

---- [Build agentid]

------ [Build definition name]

--------- Binaries {$ (outdir )}

-------------- _ Publishedwebsites

----------------------- [Web project]

-------------- [Other project]

--------- Sourcees

-------------- [Project] {$ (projectdir )}

 

If a build deinition

Name = testbuild

Drop folder = c: \ builds

Buildagentid = 1

Therefore, when the transaction is completed, the entire transaction is committed from the source controlC: \ builds \ 1 \ testbuild \ sourceesAfter the build, the project will be releasedBinariesAnd the WEB Project will be placed inBinaries \ _ publishedwebsitesSo you must specify the path to the primary line to be normal.Afterbuild.

 

Additional information

    • Visual sution 2010 Ms build
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.