ArticleDirectory
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.
- Directly use the text recorder to open a notebook (such as NotePad)
- 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