Coder Social home page Coder Social logo

mlnetexcel's Introduction

ML.NET on Excel

This project showcases the consumption of ML.NET models in Excel as an add-in.

Statement of Purpose

This repository aims to grow the understanding of consuming ML.NET models in Excel by providing an example of implementation and references to support the Microsoft Build conference in 2022. It is not intended to be a released product. Therefore, this repository is not for discussing ML.NET, Excel add-in or requesting new features.

Table of Contents

Project Structure

  • src
    • MLModels: .NET Class Library used to train models
    • MLBlazorExcelAddIn: Blazor WebAssembly application containing the Excel add-in.
      • wwwroot/functions.json: Metadata about the custom functions contained in your add-in.
      • js/interop.js: Code to set up JavaScript interop with Blazor and get data from Excel.
      • Pages/Index.cshtml: Main page containing the UI displayed in the addin as well as the code to make predictions using ML.NET.

Prerequisites

Instructions

These instructions will help you get this project up and running.

Upload model to Azure Storage Account

  1. In your Azure Storage account, create a new container called models using Azure Storage Explorer. For more information on how to create a container using Azure Storage Explorer, see Create a container.

  2. Set the public access level of the container to Public read access for blobs only. To do so using Azure Storage Explorer:

    1. Right-click the models container and select Set Public Access Level...*.

      Launch container public access level dialog in Azure Storage Explorer

    2. In the Set Container Public Access dialog, choose Public read access for blobs only.

    3. Select Apply

  3. Upload the IrisClassification.zip file in the MLModels project directory to the models container. Once uploaded, enable blob storage. For more information on uploading files to a container, see Upload blobs to the container.

  4. Copy the URL of your IrisClassification.zip blob to your clipboard. To do so in Azure Storage Explorer, right-click your blob and select Copy URL.

    Copy container blob URL to clipboard in Azure Storage Explorer

  5. Open the Index.razor in the MLBlazorExcelAddIn/Pages directory in your preferred text editor.

  6. Update the _modelUrl value with the URL you copied in previous steps.

    _modelUrl = "YOUR-MODEL-BLOB-URL";

Update the add-in manifest.xml

  1. Open the manifest.xml file in the MLBlazorExcelAddIn/wwwroot directory in your preferred text editor.
  2. Find the text "STATIC-WEBSITE-URL" and replace all instances with the URL of your static website. For more information on finding your static website URL, see Find the website URL.

Build the MLBlazorExcelAddIn project

  1. Open a terminal and navigate to the MLBlazorExcelAddIn project directory.

    cd src/MLBlazorExcelAddIn
  2. Enter the following command to build and publish the project:

    dotnet publish -c Release
    

The output from the build process is stored in the MLBlazorExcelAddIn/bin/Release/net6.0/publish/wwwroot directory.

MacOS - If you run into an error similar to "The "GetFileHash" task failed unexpectedly" building and publishing your application, see the FAQ section.

Upload Excel Add-In to static website

Use Azure Storage Explorer to upload the contents from the MLBlazorExcelAddIn/bin/Release/net6.0/publish/wwwroot directory to the $web Azure Blob Storage container. For more information on uploading files to your Azure static website container using Azure Storage Explorer, see Upload blobs to the container.

The contents of your $web container should look similar to the following.

Static website contents in $web container

Configure CORS for your static website

  1. Navigate to your Azure Storage resource in the Azure Portal.

  2. Open the Settings > Resource sharing (CORS) page.

  3. Select the Blob service tab.

  4. Add entries for the following origins:

    Allowed origins Allowed methods
    YOUR-STATIC-WEBSITE-URL GET
    0.0.0.0 GET
    https://ppc-excel.officeapps.live.com GET

    Azure Storage CORS settings

    Replace YOUR-STATIC-WEBSITE-URL with the URL you used in the manifest.xml file.

    NOTE: Make sure to remove the last backslash from the URL (i.e. https://<storage-acct-name>.z14.web.core.windows.net/ should be https://<storage-acct-name>.z14.web.core.windows.net)

Upload add-in

  1. In your browser, navigate to excel.office.com.

  2. Log in using your Microsoft Account.

  3. Create a new blank workbook. For more information on how to create a new blank workbook, see Create a workbook in Excel for the web.

  4. In the workbook, open the Office Add-ins dialog by selecting Insert > Office Add-Ins in the ribbon pane.

    Excel for web workbook with office add-ins button highlighted by red rectangle

  5. In the Office Add-Ins dialog, select Upload My Add-in to open up the upload add-in dialog.

    Office add-ins dialog with upload my add-in highlighted by red rectangle

  6. Select Browse and use the file explorer to choose the manifest.xml file.

  7. Select Upload.

    Office add-ins upload dialog with manifest.xml file

After a few seconds, your add-in is loaded. For more information on uploading your add-in, see Sideload an Office Add-in in Office on the web manually

Use the add-in to make predictions

  1. Add the following data to the first row of your workbook.

    A B C D
    5.1 3.5 1.4 0.2
  2. Use the MLNET.IRIS.PREDICT custom function defined by your add-in to make a predictions using the data you previously entered as inputs.

    Prediction made by custom function add-in

Your prediction should display in the cell where you used the custom function.

Congratulations! You've now used an ML.NET model to make predictions in Excel!

Clean up resources

Remove Excel Add-In

To remove the Excel add-in from your account, clear your browser cache.

This sample was tested using Microsoft Edge. For more information on clearing your cache on Microsoft Edge, see View and delete browser history in Microsoft Edge

Delete Azure resources

The Azure resources that you created in this sample can incur ongoing costs. To avoid such costs, delete the resource group that contains all those resources. For more information on deleting resource groups, see Delete resource groups.

Next Steps: Train your own model

Now that you've used the sample to make predictions with a pretrained ML.NET model in Excel, it's time to train your own model. The machine learning task used for this section is still classification, but the scenario the model is used in is to categorize the risk level of restaurant violations found during health inspections.

Understand the data

The data set used to train and evaluate the machine learning model is originally from the San Francisco Department of Public Health Restaurant Safety Scores. For convenience, the dataset has been condensed to only include the columns relevant to train the model and make predictions. Visit the following website to learn more about the dataset.

Each row in the dataset contains information regarding violations observed during an inspection from the Health Department and a risk assessment of the threat those violations present to public health and safety.

InspectionType ViolationDescription RiskCategory
Routine - Unscheduled Inadequately cleaned or sanitized food contact surfaces Moderate Risk
New Ownership High risk vermin infestation High Risk
Routine - Unscheduled Wiping cloths not clean or properly stored or inadequate sanitizer Low Risk
  • InspectionType: the type of inspection. This can either be a first-time inspection for a new establishment, a routine inspection, a complaint inspection, and many other types.
  • ViolationDescription: a description of the violation found during inspection.
  • RiskCategory: the risk severity a violation poses to public health and safety.

The label is the column you want to predict. When performing a classification task, the goal is to assign a category (text or numerical). In this classification scenario, the severity of the violation is assigned the value of low, moderate, or high risk. Therefore, the RiskCategory is the label. The features are the inputs you give the model to predict the label. In this case, the InspectionType and ViolationDescription are used as features or inputs to predict the RiskCategory.

Prerequisites

In ML.NET, you have the option of using low-code tooling powered by AutoML like ML.NET Model Builder and the ML.NET CLI to train machine learning models. You also have the option of using the ML.NET API which provides all of the components required to train and consume models through code-first .NET experiences.

Model Builder is a Visual Studio extension that provides a wizard-like user-interface for Windows environments. The ML.NET CLI is a .NET global tool that provides similar functionality to Model Builder through the command-line for cross-platform experiences across x64 / ARM64 devices running Windows, Mac, or Linux. For this sample, you'll use the ML.NET CLI.

Train the model

If you prefer to train the model using Model Builder, see Classify the severity of restaurant health violations with Model Builder.

  1. Open the terminal and navigate to the MLNETExcel/src directory.
  2. Use the ML.NET CLI to train a classification model.
mlnet classification --dataset C:\Datasets\RestaurantScores.csv --has-header true --label-col risk_category --name InspectionClassification --train-time 60

Make sure to replace the --dataset parameter with the location where you unzipped the RestaurantScores.csv file containing the dataset.

This command uses AutoML to search for the best algorithm and hyperparameters for your dataset and trains an ML.NET model in the span of 60 seconds (as specified by the --train-time option).

Once the training process is complete, a new .NET console project containing the model as well as training and consumption code is created in the MLNETExcel/src/InspectionClassification directory.

Configure InspectionClassification project

By default, the ML.NET CLI creates a .NET console project that can be immediately used to make predictions with your newly trained model. The resulting output is an executable. However, since the model is intended to be consumed by the MLBlazorExcelAddIn application and not as an executable, you need to configure the output type of the InspectionClassification.ConsoleApp project.

  1. Navigate to the MLNETExcel/src/InspectionClassification directory.

  2. Open the InspectionClassification.ConsoleApp.csproj file in your preferred text editor.

  3. Delete the following XML attribute:

    <OutputType>Exe</OutputType>

    Removing this attribute changes the output type from an executable to a Dynamically Linked Library (DLL).

  4. Save your changes

  5. (Optional) Delete the Program.cs file. Since you're not intending to run the application as an executable, there's no need for the application entrypoint defined in the Program.cs file.

  6. Open the terminal inside the MLNETExcel/src/InspectionClassification directory.

  7. Use the .NET CLI to clean the build output and rebuild the project.

    dotnet clean
    dotnet build
    

In your build output directory (bin/Debug/net6.0) you should see a file InspectionClassification.ConsoleApp.dll file.

Add project reference

To use the inspection model in your MLBlazorExcelAddIn project, add a reference to it.

  1. Open the terminal and navigate to the MLNETExcel/src/MLBlazorExcelAddIn directory.

  2. Use the .NET CLI to add a reference to the InspectionClassification.ConsoleApp project.

    dotnet add reference ..\InspectionClassification\InspectionClassification.ConsoleApp.csproj
    
  3. Open the _Imports.razor file inside the MLNETExcel/src/MLBlazorExcelAddIn directory in your preferred text editor.

  4. Add the following using statement to the file.

    @using InspectionClassification.ConsoleApp

Upload inspection model to Azure Blob Storage

Use Azure Storage Explorer to upload the InspectionClassification.zip model file to the models container. For more details, follow the guidance from the Upload model to Azure Storage Account section.

Update Index.razor

The Index.razor page contains the logic for loading the model from Azure Blob Storage and making predictions. Therefore it requires a few updates before using it to make predictions with the model.

  1. Open the Index.razor page in the MLNETExcel/src/MLBlazorExcelAddIn in your preferred text editor.

  2. Update the _predictionEngine variable declaration to use the InspectionClassification.ModelInput and InspectionClassification.ModelOutput schema classes.

    private PredictionEngine<InspectionClassification.ModelInput, InspectionClassification.ModelOutput> _predictionEngine;
  3. Inside the OnInitializedAsync method:

    1. Update the _modelUrl variable with the the URL of the InspectionClassification.zip model file you recently uploaded to Azure Blob Storage.

    2. Update the value of _predictionEngine to use initialize a PredictionEngine with the INspectionClassification.ModelInput and InspectionClassification.ModelOutput classes.

      _predictionEngine = mlContext.Model.CreatePredictionEngine<InspectionClassification.ModelInput,InspectionClassification.ModelOutput>(_model);
  4. Replace the current MakePrediction method with the following:

    public string MakePrediction(string inspectionType, string violationDescription)
    {
        var input = new InspectionClassification.ModelInput
        {
            Inspection_type = inspectionType,
            Violation_description = violationDescription
        };
    
        var prediction = _predictionEngine.Predict(input);
    
        return prediction.PredictedLabel;
    }

    The main changes form the previous implementation are the parameters in the method signature which are used to create an instance of InspectionClassification.ModelInput that is assigned to the input variable.

Update JavaScript interop functions

The way predictions are made in Excel is using custom functions. The code to pass data from Excel to make predictions using the Blazor application is in the wwwroot/js/interop.js file inside the MLBlazorExcelAddIn project.

  1. Open the interop.js file in your preferred text editor.

  2. Inside the MLFunctions class, update the predict function with the following code.

    static async predict(inspectionType, violationDescription) {
        const prediction = await MLFunctions.dotNetHelper.invokeMethodAsync('MakePrediction', inspectionType, violationDescription);
        console.log(prediction);
        return prediction;
    }

    Like the MakePrediction method in the Index.razor file, the main changes from the previous implementation are the parameters in the function signature which are the inputs for the MakePrediction function.

  3. Update the name of the function used in the in the custom function associate function to INSPECTION.PREDICT.

    CustomFunctions.associate("INSPECTION.PREDICT", MLFunctions.predict);

Update Excel custom function schema

Now that you've updated the code, its time to make it discoverable. This is done through the functions.json file in the src/wwwroot directory inside the MLBlazorExcelAddIn project. The functions.json contains metadata about the custom functions registered in your Excel Add-In.

  1. Open the functions.json file in your preferred text editor.

  2. Replace the contents of the file with the following:

    {
      "functions": [
        {
          "description": "Categorize health inspections",
          "id": "INSPECTION.PREDICT",
          "name": "INSPECTION.PREDICT",
          "parameters": [
            {
              "description": "Type of inspection",
              "name": "inspectionType",
              "type": "string"
            },
            {
              "description": "Detailed explanation of violation",
              "name": "violationDescription",
              "type": "string"
            }
          ],
          "result": {
            "type": "string"
          }
        }
      ]
    }

    The description, id, name, and parameters properties have changed from the previous version to reflect your custom function for predicting violation severity.

Rebuild the project and update static website

Now that you've update the application, it's time to build a new version with the latest updates.

  1. Open the terminal and navigate to the MLNETExcel/src/MLBlazorExcelAddIn directory.

  2. Use the .NET CLI to build and publish your application.

    dotnet clean
    dotnet publish -c Release
    

    The output from the build process is stored in the MLBlazorExcelAddIn/bin/Release/net6.0/publish/wwwroot directory.

  3. Use Azure Storage Explorer to upload the contents from the MLBlazorExcelAddIn/bin/Release/net6.0/publish/wwwroot directory to the $web Azure Blob Storage container. NOTE: Many of the files will already exist. To prevent conflicts, it's recommended that you delete the contents of the blob storage before uploading the new version of your application..

Re-upload manifest.xml

You shouldn't have to re-upload your manifest.xml file. However, if you cleared your cache or the add-in is no longer available in the Excel client, follow the steps in the Upload Excel Add-In section to upload the manifest.xml file to Excel.

Use the model to predict violation severity

  1. Add the following data to the first row of your workbook.

    A B
    Complaint Inadequate sewage or wastewater disposal
  2. Use the MLNET.INSPECTION.PREDICT custom function defined by your add-in to make a predictions using the data you previously entered as inputs.

Your prediction should display in the cell where you used the custom function.

Congratulations! You've now trained a custom ML.NET model and used it to make predictions in Excel!

Additional Next Steps

  • Improve your model. Choose a longer training time. Doing so allows AutoML to explore more models and hyperparameters.
  • Publish your office add-in. Doing so makes it easier for others in your organization to access your add-in. For more information on publishing add-ins, see Deploy and publish Office Add-Ins.

FAQ / Troubleshooting

The following are known issues with proposed workarounds

The "GetFileHash" task failed unexpectedly

On MacOs, you might fail to build the MLBlazorExcelAddIn project and get a message like the following:

The "GetFileHash" task failed unexpectedly

This is a known issue in .NET.

To fix it, run the dotnet publish -c Release command again.

$web container not public

In some instances you might need to make the $web container public in order to view your website. For more information, see Set the public access level for a container.

Resources

mlnetexcel's People

Contributors

luisquintanilla avatar vivihung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mlnetexcel's Issues

README Instructions - Replace all in manifest

The instructions mention replacing the static website url in the manifest file - at first, I saw the first instance and replaced it. May want to change the instructions to do a Edit > Replace (assuming VS Code, but a replace-all) to replace all instances.

README suggestions

In general, there are too many setup steps with Azure blob. Can we write a script to streamline the process?

  1. Specify the sku suggestion when createing Azure Storage Account?
  2. Add instruction about how to find model blob url.
  3. Add hypterlink to find static website url - https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website-how-to?tabs=azure-portal#find-the-website-url
  4. Upload folders with files to $web is annoying... The Azure portal's storage browser (preview) doesn't support folder upload. Need to use Azure Storage Explorer app. Should we recommend users to use Azure Storage Explorer in this step?
  5. In the step of "In your browser, navigate to excel.office.com", the hyperlink of excel.office.com is wrong. It points to https://excel.microsoft.com/
  6. Add instructions to hint user login with their Microsoft account.
  7. Add instructions about uninstall add-in by clean up browser cache.

Question: Are the add-in available to other users if I share the file? (based on the add-in is stored in browser storage, I would guess no... but would like to confirm with you)

Fail to deploy via ARM Template

Love love love the ARM support in instruction!
While creating resources from the custom template, notice strange default values in Location and Storage Account Name.
Is it expected?
image

MacOS - Fail to build MLBlazorExcelAddIn project

OS: Monterey v12.3.1
Processor: Intel i7

Follow the instructions, but failed on building MLBlazorExcelAddIn project
dotnet publish -c Release

Detail logs from terminal

myaccount@mycomputername MLBlazorExcelAddIn % dotnet publish -c Release

Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.202

Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Microsoft (R) Build Engine version 17.1.1+a02f73656 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored /Users/vivihung/Code/MLNETExcel/src/MLModels/MLModels.csproj (in 7.24 sec).
  Restored /Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj (in 7.39 sec).
/Users/vivihung/Code/MLNETExcel/src/MLModels/IrisClassification.consumption.cs(59,28): warning CS8618: Non-nullable property 'Features' must contain a non-null value when exiting constructor. Consider declaring the property as nullable. [/Users/vivihung/Code/MLNETExcel/src/MLModels/MLModels.csproj]
/Users/vivihung/Code/MLNETExcel/src/MLModels/IrisClassification.consumption.cs(62,27): warning CS8618: Non-nullable property 'PredictedLabel' must contain a non-null value when exiting constructor. Consider declaring the property as nullable. [/Users/vivihung/Code/MLNETExcel/src/MLModels/MLModels.csproj]
/Users/vivihung/Code/MLNETExcel/src/MLModels/IrisClassification.consumption.cs(65,28): warning CS8618: Non-nullable property 'Score' must contain a non-null value when exiting constructor. Consider declaring the property as nullable. [/Users/vivihung/Code/MLNETExcel/src/MLModels/MLModels.csproj]
/Users/vivihung/Code/MLNETExcel/src/MLModels/IrisClassification.consumption.cs(31,27): warning CS8618: Non-nullable property 'Col4' must contain a non-null value when exiting constructor. Consider declaring the property as nullable. [/Users/vivihung/Code/MLNETExcel/src/MLModels/MLModels.csproj]
  MLModels -> /Users/vivihung/Code/MLNETExcel/src/MLModels/bin/Release/net6.0/MLModels.dll
/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/Pages/Index.razor(34,93): warning CS8618: Non-nullable field '_predictionEngine' must contain a non-null value when exiting constructor. Consider declaring the field as nullable. [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/Pages/Index.razor(37,20): warning CS8618: Non-nullable field '_modelUrl' must contain a non-null value when exiting constructor. Consider declaring the field as nullable. [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/Pages/Index.razor(36,21): warning CS0169: The field 'Index.result' is never used [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
  MLBlazorExcelAddIn -> /Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/bin/Release/net6.0/MLBlazorExcelAddIn.dll
  MLBlazorExcelAddIn (Blazor output) -> /Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/bin/Release/net6.0/wwwroot
  Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018: The "GetFileHash" task failed unexpectedly. [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018: System.AggregateException: One or more errors occurred. (Access to the path '/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/obj/Release/net6.0/linked/System.Text.Encodings.Web.dll' is denied.) (Access to the path '/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/obj/Release/net6.0/linked/System.Runtime.Numerics.dll' is denied.) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:  ---> System.UnauthorizedAccessException: Access to the path '/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/obj/Release/net6.0/linked/System.Text.Encodings.Web.dll' is denied. [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:  ---> System.IO.IOException: Operation not permitted [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    --- End of inner exception stack trace --- [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at Interop.CheckIo(Error error, String path, Boolean isDirectory, Func`2 errorRewriter) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at System.IO.File.OpenRead(String path) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at Microsoft.Build.Tasks.GetFileHash.ComputeHash(Func`1 algorithmFactory, String filePath) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at Microsoft.Build.Tasks.GetFileHash.<>c__DisplayClass28_0.<Execute>b__0(Int32 index) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018: --- End of stack trace from previous location --- [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at System.Threading.Tasks.TaskReplicator.Replica.Execute() [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    --- End of inner exception stack trace --- [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at System.Threading.Tasks.TaskReplicator.Run[TState](ReplicatableUserAction`1 action, ParallelOptions options, Boolean stopOnFirstFailure) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018: --- End of stack trace from previous location --- [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException(ICollection exceptions, CancellationToken cancelToken, Exception otherException) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action`1 body) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at Microsoft.Build.Tasks.GetFileHash.Execute() [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:  ---> (Inner Exception #1) System.UnauthorizedAccessException: Access to the path '/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/obj/Release/net6.0/linked/System.Runtime.Numerics.dll' is denied. [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:  ---> System.IO.IOException: Operation not permitted [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    --- End of inner exception stack trace --- [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at Interop.CheckIo(Error error, String path, Boolean isDirectory, Func`2 errorRewriter) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at System.IO.File.OpenRead(String path) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at Microsoft.Build.Tasks.GetFileHash.ComputeHash(Func`1 algorithmFactory, String filePath) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at Microsoft.Build.Tasks.GetFileHash.<>c__DisplayClass28_0.<Execute>b__0(Int32 index) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018: --- End of stack trace from previous location --- [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:    at System.Threading.Tasks.TaskReplicator.Replica.Execute()<--- [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]
/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(528,5): error MSB4018:  [/Users/vivihung/Code/MLNETExcel/src/MLBlazorExcelAddIn/MLBlazorExcelAddIn.csproj]

Error running MLNET Add-on

After uploading the manifest, received the following error. It was not clear how I could fix this.

InvalidQueryParameterValueValue for one of the query parameters specified in the request URI is invalid. RequestId:2e7f2423-f01e-002a-4e0c-646ada000000 Time:2022-05-10T01:22:29.0303870Zcomp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.