InliningAnalyzer icon indicating copy to clipboard operation
InliningAnalyzer copied to clipboard

No analysis results after running inline analysis

Open 1996v opened this issue 5 years ago • 6 comments

class Program
{
    int inli(string f)
    {
        return int.Parse(f);
    }
    int ninli(string f)
    {
        try
        {
            return int.Parse(f);
        }
        catch (Exception e)
        {
            return 0;
        }
    }

    void Main(string[] args)
    {
        inli("s");
        ninli("h");
    }
}

<OutputType>Library</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<PlatformTarget>x64</PlatformTarget>

the configuration of inlining analyzer has not been modified.
when the output window outputs finished inlining analyzer, there is no change on the code view.
so, I want to know what I missed.
thanks

1996v avatar Jan 02 '20 10:01 1996v

I think I can reproduce the issue. Looks like a bug with the handling of multiple installed .Net Core versions. I don't have a fix yet, need to investigate this further.

szehetner avatar Jan 02 '20 22:01 szehetner

I am experiencing the same issue, but want to try the extension still. Do you think nuking Core runtimes and SDKs for good is a viable workaround?

ghost avatar Jan 04 '20 21:01 ghost

I could get it to work with 2.x runtimes, but not with 3.1, so this is something you could try:

Open "Tools" -> "Inlining Analyzer" -> "Options" and specify a ".NET Core Version". This is the explicit runtime version the analyzer will be run with. 2.1.14 worked for me, while 3.1.0 didn't. I guess a 2.2.x and possibly 3.0.x should work as well if you have it installed (see dotnet --info).

I didn't get around to investigate why 3.1 doesn't work yet.

szehetner avatar Jan 04 '20 22:01 szehetner

Thank you! That (setting .NET Core version to 2.1.14) solved the issue.

ghost avatar Jan 05 '20 10:01 ghost

I fixed this problem by setting .net core version to 2.1.5
My .net core framework is 2.1.0, but when I specify 2.1.0, I will be prompted with an error: the specified framework 'Microsoft. NETCORE. App', version '2.1.0' was not found. It does look like an error caused by inconsistent versions of .net core.

1996v avatar Jan 09 '20 09:01 1996v

Are you sure you have a 2.1.0 runtime installed? You can check which runtimes you have by running dotnet --info and look for all "Microsoft.NetCore.App" versions. These are the ones you can specify in the Inlining Analyzer options.

szehetner avatar Jan 09 '20 21:01 szehetner