命令行MSBuild无法编译代码

时间:2016-03-16 22:19:37

标签: c# command-line compilation compiler-errors msbuild

任何人都可以告诉我为什么命令行msbuild无法构建此代码?

public SourceControlHandler(string sourceControlUser = null, string sourceControlPassword = null, string sourceControlDomain = null)
        {    
            var client = new SvnClient();
            if (!string.IsNullOrEmpty(SourceControlUser) && !string.IsNullOrEmpty(SourceControlPassword))
            {
                client.Authentication.Clear();
                client.Authenticatio​n.UserNameHandlers += delegate (object sender, Sv​nUserNameEventArgs e)
                {
                    e.UserName = SourceControlUser;
                };
            _svnClient = client;
        }

错误是:

d:\DEV\EP.BuildAndDeploy\BuildResources\BuildProjects.build" (Rebuild target)
1) ->
D:\DEV\EP.BuildAndDeploy\EP.BuildService\EP.BuildService.csproj" (default targ
t) (5) ->
CoreCompile target) ->
 Handlers\SourceControlHandler.cs(44,39): error CS1002: ; expected [D:\DEV\EP.
uildAndDeploy\EP.BuildService\EP.BuildService.csproj]
 Handlers\SourceControlHandler.cs(44,39): error CS1525: Invalid expression ter
 '.' [D:\DEV\EP.BuildAndDeploy\EP.BuildService\EP.BuildService.csproj]
 Handlers\SourceControlHandler.cs(44,40): error CS1002: ; expected [D:\DEV\EP.
uildAndDeploy\EP.BuildService\EP.BuildService.csproj]
 Handlers\SourceControlHandler.cs(44,107): error CS1026: ) expected [D:\DEV\EP
BuildAndDeploy\EP.BuildService\EP.BuildService.csproj]
 Handlers\SourceControlHandler.cs(44,108): error CS1002: ; expected [D:\DEV\EP
BuildAndDeploy\EP.BuildService\EP.BuildService.csproj]
 Handlers\SourceControlHandler.cs(44,108): error CS1525: Invalid expression te
m ')' [D:\DEV\EP.BuildAndDeploy\EP.BuildService\EP.BuildService.csproj]
 Handlers\SourceControlHandler.cs(44,109): error CS1002: ; expected [D:\DEV\EP
BuildAndDeploy\EP.BuildService\EP.BuildService.csproj]
 Handlers\SourceControlHandler.cs(48,14): error CS1002: ; expected [D:\DEV\EP.
uildAndDeploy\EP.BuildService\EP.BuildService.csproj]
 Handlers\SourceControlHandler.cs(50,10): error CS1513: } expected [D:\DEV\EP.
uildAndDeploy\EP.BuildService\EP.BuildService.csproj]

Visual Studio 2015编译它没有问题,代码不会抛出任何运行时错误。 列出的代码从第38行开始。因此MSBuild / CSC抱怨 - 第一个错误 - 关于第二个点:client.Authenticatio n.UserNameHandlers;

想法?

1 个答案:

答案 0 :(得分:2)

Authenticationo之间的n字符不可显示。 在键盘上使用箭头键时可以看到它。