1
Vote

Method TryGet<T> won't compile

description

The following method won't compile:
  public bool TryGet<T>(out T result) where T : class
    {
        Contract.Ensures(Contract.Result<bool>() ? Contract.ValueAtReturn(out result) != null : Contract.ValueAtReturn(out result) == null);

        return true;
    }

comments

pjvandesande wrote May 5, 2010 at 6:45 PM

First of all, thanks for the report. But I can't find this code anywhere. Can you please tell me in which file it is located?

nesteruk wrote May 6, 2010 at 8:15 PM

Getting a different error now:

error CS1504: Source file 'C:\Users\Administrator\Projects\Globals\NCQRS\Framework\src\Ncqrs\Commanding\ServiceModel\CommandContext.cs' could not be opened ('Unspecified error ')

pjvandesande wrote May 7, 2010 at 9:19 AM

It seems you are using the latest changeset from the code repository. There is a small error in there that the CommandContext.cs is references in the Ncqrs.csproj file, but that must be CommandServiceExecutionContext.cs. You can removed the CommandContext.cs file from the project and include CommandServiceExecutionContext.cs, that should do the trick. I'll fix this in the next changeset. Thx!

nesteruk wrote May 8, 2010 at 2:36 PM

This is now fixed in the latest source code.

** Closed by nesteruk 05/08/2010 7:36AM

nesteruk wrote May 10, 2010 at 6:55 AM

Hi, back to this error now. It's happening in the IEnvironmentConfiguration.cs file, line 31:
    public bool TryGet<T>(out T result) where T : class
    {
        Contract.Ensures(Contract.Result<bool>() ? Contract.ValueAtReturn(out result) != null : Contract.ValueAtReturn(out result) == null);

        return true;
    }

nesteruk wrote May 10, 2010 at 6:56 AM

pjvandesande wrote May 10, 2010 at 7:48 AM

Can you tell me what kind of error you get?