#Question about C# Cloud Code Modules

1 messages · Page 1 of 1 (latest)

surreal trellis
#

Doesn't seem to work either, my module can no longer be instantiated on UGS:

#

I get the same error when I just copy/paste the example code:

marsh coral
#

Hi, for those errors, can you check which version of the logging package you have installed? Currently we don't support v8 (working on it), so you may need to downgrade to 7.

For locally creating an instance of your class (e.g. for a unit test), you can either create an instance of a logger (for example new Logger<CombatController>(new NullLoggerFactory()); will create a dummy logger, see the Microsoft docs if you want to attach it to the console), or pass a mock/stub that implements ILogger. You could also pass null as long as you use the null-conditional operator (?.) to avoid throwing a null ref exception (e.g. _logger?.LogInformation(...) .

surreal trellis
marsh coral
#

In Nuget package manager (or your .csproj) you should be able to see the version you're referencing

surreal trellis
#

is there a specific one I need to downgrade? it's pretty much all 8

marsh coral
#

I believe it's just the Logging and DependencyInjection packages you'll need to downgrade

surreal trellis
#

did I miss that somewhere in the docs?

#

ah nice, thank you! 🙂

#
public string SayHello(IExecutionContext ctx, string name)```
What is `IExecutionContext ctx`, do I need to include it every time I want to be able to do logging?
#

Looks like it works without it too