question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build instructions in readme.md are complicated and don't work -- please provide a VS project template.

See original GitHub issue

Using VS 2017 15.6.4, I created a new .NET Core MVC app.

I followed build instructions up to the ElectronNET.CLI nuget package part (which is super ambiguous).

I added the DotNetCliToolReference to my .csproj like so (it didn’t say to remove the other ones, so I left them alone):

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="ElectronNET.API" Version="0.0.9" />
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />
  </ItemGroup>

  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.3" />
    <DotNetCliToolReference Include="ElectronNET.CLI" Version="0.0.9" />
  </ItemGroup>
  
</Project>

dotnet restore did not add the CLI package that I just added.

and manually calling Install-Package ElectronNET.CLI -Version 0.0.9 fails because it’s not compatible with this project type: Install-Package : Package 'ElectronNET.CLI 0.0.9' has a package type 'DotnetCliTool' that is not supported by project 'ElectronTest'.

(Also requiring folks to hand edit a .csproj is kind of wacky – please just provide a visual studio template.)

Trying to run the project, it opens a chrome web browser up to the site (not an electron window).

Further details, program.cs:

    public class Program
    {
        public static void Main(string[] args)
        {
            BuildWebHost(args).Run();
        }

        public static IWebHost BuildWebHost(string[] args)
        {
            return WebHost.CreateDefaultBuilder(args)
                .UseElectron(args)
                .UseStartup<Startup>()
                .Build();
        }
    }

startup.cs:

    public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the
        // container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();
        }

        // This method gets called by the runtime. Use this method to configure the HTTP
        // request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseBrowserLink();
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            // Open the Electron-Window here
            Task.Run(async () => await Electron.WindowManager.CreateWindowAsync());
        }
    }

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
robertmuehsigcommented, Jan 3, 2019

We updated the readme.

The DotNetCliToolReference is “old” - the new style requires to install it as a global tool:

dotnet tool install ElectronNET.CLI -g

After that you should be able to invoke like this (in the same folder as the .csproj file)

electronize start 

Hope this helps!

0reactions
LukeTOBriencommented, Jul 6, 2020

@robertmuehsig This should be on your main documentation (if you can call a readme main documentation), I just had and same thing and came to this issue after a Google search - Everyone who uses Electron.NET is going to have the same issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

README.md template | Documenting your project
Information about content and formatting of project README files.
Read more >
Basic writing and formatting syntax
Create sophisticated formatting for your prose and code on GitHub with simple syntax.
Read more >
Why isn't my Readme.md showing up on the Visual Studio ...
I've created a project in VSO, using a GIT repository, and placed a Readme.md file in the root. Why isn't the Readme.md showing...
Read more >
README File – Everything you Need to Know
A README file is a text file that describes and launches a project. It comprises information that is frequently needed to grasp the...
Read more >
Make a README
Learn how to make a great README for your programming project, and use the editable template to get started.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found