Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sublime output doesn't behavior as command line execution. #31

Open
AlbertoMonteiro opened this issue May 6, 2015 · 0 comments
Open

Comments

@AlbertoMonteiro
Copy link

I have a simple script

#r "System.ComponentModel.DataAnnotations"
using System.ComponentModel.DataAnnotations;

class Person
{
    [Required]
    public string Name { get; set; }

    [Required]
    public int Age { get; set; }

    [Required, MaxLength(4)]
    public string Nickname { get; set; }
}

var pessoa = new Person();

pessoa.Name = "Alberto";
pessoa.Age = 25;
pessoa.Nickname = "Alberto Monteiro";

var validationContext = new ValidationContext(pessoa);
var results = new List<ValidationResult>();
var valid = Validator.TryValidateObject(pessoa, validationContext, results, true);

foreach (var result in results) 
{
    Console.WriteLine(result.ErrorMessage);
}

When running on Sublime and pressing CTRL + B

I got this output:

[Finished in 5.5s]

When running on command line using this commnad:

PS C:\Temp> scriptcs -script .\Validacao.csx -cache false

I got this output

O campo Nickname deve ser uma cadeia de caracteres ou tipo de matriz com comprimento máximo de '4'.

Why the sublime output doesn't work properly?

PS C:\Temp> scriptcs -v
               _       _
 ___  ___ _ __(_)_ __ | |__ ___ ___
/ __|/ __| '__| | '_ \| __// __/ __|
\__ \ (__| |  | | |_) | |_| (__\__ \
|___/\___|_|  |_| .__/ \__\\___|___/
                |_| Version: 0.14.1
Sublime Build: 3083
SO: Windows 8.1 Enterprise
scriptcs plugin version: v2014.11.02.23.17.05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant