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

Invalid runtimeconfig.json in .NET Benchmark #1328

Closed
VladimirFedorchenko7 opened this issue Dec 12, 2019 · 14 comments
Closed

Invalid runtimeconfig.json in .NET Benchmark #1328

VladimirFedorchenko7 opened this issue Dec 12, 2019 · 14 comments
Labels

Comments

@VladimirFedorchenko7
Copy link

I have simple benchmark project(using BenchmarkDotNet lib) on .net core 3.1 that print Hello message to console. When project on disk D root the benchmark runs successfully, but if my project deeper in file system it fails with invalid runtimeconfig.json. Please, help me.

@AndreyAkinshin
Copy link
Member

@VladimirFedorchenko7 could you please share the source code of your project and the full text of the error?

@VladimirFedorchenko7
Copy link
Author

VladimirFedorchenko7 commented Dec 12, 2019

It is the code:

using System;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;

namespace BenchmarkTest
{
    class Program
    {
        static void Main(string[] args)
        {
            BenchmarkRunner.Run<Test>();
        }
    }

    public class Test
    {
        [Benchmark]
        public void Run()
        {
            Console.WriteLine("Hello World!");
        }
    }
}

It is the error(sorry I can't show you name of my project):
image

@AndreyAkinshin
Copy link
Member

@VladimirFedorchenko7 do you have spaces in the full path to your project?

@VladimirFedorchenko7
Copy link
Author

@AndreyAkinshin No, I have no spaces in the full path to my project.

@AndreyAkinshin
Copy link
Member

@VladimirFedorchenko7 could you please show the content of your *.runtimeconfig.dev.json file?

@VladimirFedorchenko7
Copy link
Author

@AndreyAkinshin
{ "runtimeOptions": { "additionalProbingPaths": [ "C:\\Users\\user\\.dotnet\\store\\|arch|\\|tfm|", "C:\\Users\\user\\.nuget\\packages", "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" ] } }
It was generated automatically.

@AndreyAkinshin
Copy link
Member

@VladimirFedorchenko7 ok, one more question: could you say the full path length of the *.runtimeconfig.dev.json file (including the file name)?

@VladimirFedorchenko7
Copy link
Author

@AndreyAkinshin D:\Projects\MyProject\resources\Performance\Performance.Core\bin\Release\netcoreapp3.1\28fb67a8-6dfa-4475-bff6-ae9b4e31f3c6.runtimeconfig.dev.json

@VladimirFedorchenko7
Copy link
Author

@AndreyAkinshin In .NET framework benchmark was a problem with too long name of class. I solved this problem just changed the name to short one.

@VladimirFedorchenko7
Copy link
Author

@AndreyAkinshin But in Core project I can't solve this problem. Why did you close the question?

@VladimirFedorchenko7
Copy link
Author

@AndreyAkinshin I have two benchmark projects: on .NET Framework and .NET Core. In .NET Framework was a trouble with name lenght, I solved it, but I think it is a bug and must be fixed. In .NET Core project I can't solve this problem. Please, help me.

@AndreyAkinshin
Copy link
Member

@adamsitnik any ideas what can be wrong with runtimeconfig?

@adamsitnik
Copy link
Member

We have two different toolchains, one for .NET Core and one for Full .NET Framework.

The .NET Core toolchain creates files with longer paths. All the guids etc in the path of the auto-generated are to protect us from duplicates.

We don't generate runtimeconfig.json, it's generated by dotnet cli when we call dotnet restore|build from the toolchain.

I agree that the long path problem reported as "invalid runtimeconfig.json" is wrong, but it's an output from dotnet cli.

@VladimirFedorchenko7 could you please create a simple .NET Core app (dotnet new console should be enough) somewhere deep in the file hierarchy, try to build it and report a bug in https://github.com/dotnet/sdk ?

Once you do that, please enable long paths support on your system or move the project closer to the root.

@VladimirFedorchenko7
Copy link
Author

@adamsitnik Thank you for helping. Enabling long path support resolved my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants