SteeltoeOSS / Tooling

Steeltoe developer tool collection
https://steeltoe.io/
Apache License 2.0
12 stars 7 forks source link

Error when running SteelToeCloudfoundry application template for Cloud foundry (linux) locally #92

Closed VenkateshSrini closed 4 years ago

VenkateshSrini commented 4 years ago

Issue 1 When I try to run the application created by Visual studio application created by SteelToe Cloud foundry (Linux) .NET core template on my local machine, I get an null reference error. The code

public ActionResult<IEnumerable<string>> Get()
        {
            string appName = _appOptions.ApplicationName;
            string appInstance = _appOptions.ApplicationId;
            /*_serviceOptions.Services["user-provided"]
                                    .First(q => q.Name.Equals("xxxxxxx"))
                                    .Credentials["xxxxxxx"].Value*/

            return new string[] { appInstance.ToString(), appName };
        }

should be

public ActionResult<IEnumerable<string>> Get()
        {
            string appName = _appOptions?.ApplicationName;
            string appInstance = _appOptions?.ApplicationId;
           return new string[] { appInstance?.ToString(), appName };
        }

Issue 2 The appSettings is missing vcap:services. If you can add some dummy serviceand search for the same then it will be good. Issue 3 This is highly opinionated. The code snippet

    /*_serviceOptions.Services["user-provided"]
                                    .First(q => q.Name.Equals("xxxxxxx"))
                                    .Credentials["xxxxxxx"].Value*/

should be


            //service.Name.CompareTo("xxx") == 0).Credentials["xxx"].Value; ```
ddieruf commented 4 years ago

Hi @VenkateshSrini,

We have moved the project to steeltoe incubator and updated to the latest Steeltoe & .NET versions.

Specifically to your feedback, thank you. These are all good suggestions. Would you mind taking a moment to create a PR with these updates? I would be happy to review.

VenkateshSrini commented 4 years ago

I'm talking of the generated code here and I do not understand the template engine. So how could I still create a pr

jkonicki commented 4 years ago

Closing this as the code has moved to new location/org: https://github.com/steeltoeoss-incubator/vs-extensions/issues/1