ArduinoUploader NuGet package - c#

I have downloaded the NuGet package Arduino Uploader (https://www.nuget.org/packages/ArduinoUploader/), and receive the following error when trying to run it using the example on the github page (https://github.com/twinearthsoftware/ArduinoSketchUploader) under the .Net package.
The code is as follows
var upload = new ArduinoSketchUploader(
new ArduinoSketchUploaderOptions()
{
FileName = #"location of the file",
PortName = "COM7",
ArduinoModel = ArduinoModel.Micro
});
upload.UploadSketch();
The error of Exception unhandled occurs on the upload.UploadSketch(); line giving off
ArduinoUploader.ArduinoUploaderException: 'Exception during close of the programmer: 'Object reference not set to an instance of an object.'.'`.
The details copied from Visual Studio are `ArduinoUploader.ArduinoUploaderException
HResult=0x80131500
Message=Exception during close of the programmer: 'Object reference not set to an instance of an object.'.
Source=ArduinoUploader
StackTrace:
at ArduinoUploader.BootloaderProgrammers.Protocols.AVR109.Avr109BootloaderProgrammer.Close()
at ArduinoUploader.ArduinoSketchUploader.UploadSketch(IEnumerable`1 hexFileContents)
at ArduinoUploader.ArduinoSketchUploader.UploadSketch()
at arduino_sending_code.Program.Main(String[] args) in C:\Users\User\source\repos\arduino sending code\arduino sending code\Program.cs:line 39
This exception was originally thrown at this call stack:
[External Code]
arduino_sending_code.Program.Main(string[]) in Program.cs
Are there any suggestions to overcome this error?

The error you recieved is due to a dodgy hex file. You need to find the hex file from temp folder on your computer where the computer places them. Thats the only file which works. Also later on you might face an issue with another error, make sure you have the right programmer on the arduino, the details are avilable under the bootloader column on the ArduinoUploader github page.

Related

Unsupported by Aspose.HTML for .NET symbols in the name of input html file

I am using Aspose.HTML for .NET library and I found out that it doesn’t support ‘#’ character in the name of the input html file when windows handles it OK. Is there any solution of this issue?
Here is sample code:
using (var document = new HTMLDocument(#“D:\work\!%#&$^#.html”))
{
Console.WriteLine(document.BaseURI);
Console.WriteLine(“OK”);
}
Exception I get:
Unhandled Exception: System.Exception: ‘file:///D:/work/!%#&$^#.html’ could not be found. —> Aspose.Html.Dom.DOMException: ‘file:///D:/work/!%#&$^#.html’ could not be found.
at :clubs: .:heart: [T](UInt16 :slight_smile:, String :heart:, String :clubs:, Object[])
at :clubs: .:heart:(String :slight_smile:, Object[] :heart:)
at Aspose.Html.Dom.Document.:heart: .:slight_smile:.:slight_smile:()
at :clubs: .:slight_smile:()
— End of inner exception stack trace —
at .:heart: :slight_smile:(Boolean :slight_smile:)
at :heart: .Dispose()
at Aspose.Html.Dom.Document.:slight_smile:(☼ :slight_smile:)
at Aspose.Html.Dom.Document…ctor(IDocumentInit documentInit)
at Aspose.Html.HTMLDocument…ctor(RequestMessage :slight_smile:, Configuration :heart:, Byte :clubs:)
at Aspose.Html.HTMLDocument…ctor(String address)
at ConsoleApplication1.Program.Main(String[] args) in D:\Labs\PathTest\ConsoleApplication1\Program.cs:line 19
This file definitely exists. I am using Aspose.HTML 20.11.0. Updating to the latest one doesn’t solve this issue

c# How do I use this function on a file

Sorry if the title may be misleading, but I have created a decoder in c#, but how do I use the function on (save.dat (the game save)) it needs to be loaded in a byte array.
Code for the decoder: https://del.dog/sorononami
Sorry I'm a starter in c#.
I have tried but I got this error:
Unhandled Exception: System.TypeInitializationException: The type initializer for 'ConsoleApp8.Program' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at ConsoleApp8.Program.PwDecLol(Byte[] lel) in C:\repos\ConsoleApp8\ConsoleApp8\Program.cs:line 180
at ConsoleApp8.Program..cctor() in C:\repos\ConsoleApp8\ConsoleApp8\Program.cs:line 183
--- End of inner exception stack trace ---
at ConsoleApp8.Program.Main() in C:\repos\ConsoleApp8\ConsoleApp8\Program.cs:line 15
Looks like I am not doing it correctly
I don't think it's anything wrong with your decoder. The error message suggests you have a parameter in the constructor to your program, which the runtime doesn't know how to resolve.
Try removing any parameters from the main entry point into your programs (except string[] args).
Alternatively, post the code from your program's entry point.

In Xamarin.Android getting resource id "Android.Content.Res.Resources+NotFoundException:" error occur

I want to get id(int) for audio file from Asset folder but it give me error.
var File_Id = Resources.GetIdentifier("my_file.ogg","Assets", PackageName);
Above line of code execute in android Service
it give error,
Error Log:
03-13 14:03:50.047 W/ResourceType(13170): No package identifier when getting value for resource number 0x00000000
Unhandled Exception:
Android.Content.Res.Resources+NotFoundException: Resource ID #0x0
this file "my_file.ogg" is in "Asset" folder ,build action set to "AndroidAsset"
The asset can be read using the AssetsManager. Try below code snippet to read file from asset.
Android.Content.Res.AssetFileDescriptor afd = this.Assets.OpenFd("File name");
Updated Answer :
The following code snippet will help to play media file directly from the Asset folder.
Android.Content.Res.AssetFileDescriptor afd = this.Assets.OpenFd(fullPath);
if (afd != null )
{
player.SetDataSource (afd.FileDescriptor, afd.StartOffset, afd.Length);
player.Prepare ();
player.Start ();
}
In my case, I had a Xamarin Forms project. I had included a resource in the iOS project which the xaml page was referring to, but forgot to include it in the Android project.

Instantiating a .NET class with a reference to a dll causes FileNotFoundException

I've added as reference PDFSharp classes for a project. When I tried to use a method in a class that includes PDFSharp libraries I get a FileNotFoundException that states I'm missing the referenced (PDFSharp) file (while I can assure you the dll file is there).
So I've tried adding and readding and changing the dll version, but still without success. So I switched to PDFClown, a similar purpose library, but the error is the same: FileNotFoundException at runtime.
The exception is thrown even before the method is executed.
Calling method (where the exception is thrown):
//method call: here the debugger stops at the breakpoint
ReportUtils.CreateFile(tempDirectoryPath ecc);
Called method:
using org.pdfclown.documents;
using org.pdfclown.documents.contents.composition;
using org.pdfclown.documents.contents.fonts;
using clownFiles = org.pdfclown.files;
class ReportUtils
{
public static void CreateFile(/*parameters*/)
{
//the debugger never enter here: the exception is thrown before
string filename = Settings.ReportFileName + String.Format("{0:yyyyMMddHHmmssffff}", DateTime.Now);
//ecc
}
//...
Why is this exception showing up? Am I doing something wrong adding the references?
I could reproduce your issue by setting the option Copy Local on my library to false. Please, make sure this boolean is set to true..

Cassette.AssetReferenceException being fired when removing a file from folder

I used to have a .js file in /Public/javascripts/jquery1.1js.
Everything was working perfectly but then I needed to delete this file from my project, so I just removed it from the solution in Visual Studio.
Now when I visit my application, I get:
Reference error in "~/Public/javascripts/jquery.unobtrusive-ajax.js",
line 1. Cannot find "~/Public/javascripts/jquery-1.5.1.js". Reference
error in "~/Public/javascripts/jquery.validate.unobtrusive.js", line
1. Cannot find "~/Public/javascripts/jquery-1.5.1.js".
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: Cassette.AssetReferenceException: Reference error
in "~/Public/javascripts/jquery.unobtrusive-ajax.js", line 1. Cannot
find "~/Public/javascripts/jquery-1.5.1.js". Reference error in
"~/Public/javascripts/jquery.validate.unobtrusive.js", line 1. Cannot
find "~/Public/javascripts/jquery-1.5.1.js".
Here's a stacktrace:
[AssetReferenceException: Reference error in "~/Public/javascripts/jquery.unobtrusive-ajax.js", line 1. Cannot find "~/Public/javascripts/jquery-1.5.1.js".
Reference error in "~/Public/javascripts/jquery.validate.unobtrusive.js", line 1. Cannot find "~/Public/javascripts/jquery-1.5.1.js".]
Cassette.BundleContainer.ValidateAssetReferences() +387
Cassette.BundleContainer..ctor(IEnumerable`1 bundles) +41
Granted, I know why this is happening, Cassette is still trying to find the deleted file, but I'm not sure how to tell Cassette: "Hey, this file is no longer relevant. Scan the folder again and rebuild a list of files you need to work with."
But I just don't know how to accomplish this.
The documentation has no mention of this and just implies that it should do this automatically for me.
Here's my Configuration class:
using Cassette.Configuration;
using Cassette.Scripts;
using Cassette.Stylesheets;
namespace XXX.WebUI
{
/// <summary>
/// Configures the Cassette asset modules for the web application.
/// </summary>
public class CassetteConfiguration : ICassetteConfiguration
{
public void Configure(BundleCollection bundles, CassetteSettings settings)
{
bundles.AddPerIndividualFile<ScriptBundle>("Public/javascripts/");
bundles.AddPerIndividualFile<StylesheetBundle>("Public/stylesheets/");
}
}
}
And in my _Layout.cshtml file:
#{
Bundles.Reference("Public/javascripts/site.js");
Bundles.Reference("Public/javascripts/jquery.validate.unobtrusive.js");
Bundles.Reference("Public/stylesheets/site.less");
}
<!DOCTYPE html>
...
<head>
<title>#ViewBag.Title</title>
#Bundles.RenderStylesheets()
...
#Bundles.RenderScripts()
</body>
Does the jquery.validate.unobtrusive.js file contain a JavaScript reference at the top to jquery-1.5.1.js?
The line would look like:
/// <reference path="jquery-1.5.1.js" />
If so, remove that line. Cassette uses those references to determine build order.
ref: http://getcassette.net/documentation/scripts
This can also happen if you reference files with the same root
e.g. easyXDM.js and easyXDM.debug.js
When you reference easyXMD.js it gives the exception and the solution seems to be use a different naming convention that ensures the roots are different such as easyXMDdebug.js.

Categories