Command line MSBuild fails to compile code

六月ゝ 毕业季﹏ 提交于 2019-12-13 06:07:50

问题


Can anyone tell me why command-line msbuild fails to build this code?

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;
        }

The errors are:

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 has no issues compiling it and the code is not throwing any run-time errors. The listed code starts at line 38. Therefore MSBuild/CSC is complaining - first error - about the second dot in: client.Authenticatio​n.UserNameHandlers;

Ideas?


回答1:


You have a not displayable character in Authentication between oand n. You can see it when playing with arrow keys on keyboard.



来源:https://stackoverflow.com/questions/36048043/command-line-msbuild-fails-to-compile-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!