QR Scanning in HoloLens - DLL errors - c#

I am attempting to implement a QR Code reader from within HoloLens, working off of Mike Taulty's solution (https://mtaulty.com/2016/12/28/windows-10-uwp-qr-code-scanning-with-zxing-and-hololens/). However, I am having an issue with building out the project in Unity, as I am getting a build error: "Assets\Placeholder.cs(20,9): error CS0103: The name 'MediaFrameQrProcessing' does not exist in the current context", which seems to be implying that the DLLs aren't working properly? A already have a DLL by the same name in my project, and I would assume that this DLL would cover this issue, but it appear to not.
I am running Unity 2018.4.1 and Visual Studio 2019. I am building on top of his GitHub repo (https://github.com/mtaulty/QrCodes).
This is the block that throws the build error. MediaFrameQrProcessing cannot be found
public void OnScan()
{
this.textMesh.text = "scanning for 30s";
#if !UNITY_EDITOR
MediaFrameQrProcessing.Wrappers.ZXingQrCodeScanner.ScanFirstCameraForQrCode(
result =>
{
UnityEngine.WSA.Application.InvokeOnAppThread(() =>
{
this.textMesh.text = result ?? "not found";
},
false);
},
TimeSpan.FromSeconds(30));
#endif
}
Expected: Project Builds w/o incident
Actual Results: Assets\Placeholder.cs(20,9): error CS0103: The name 'MediaFrameQrProcessing' does not exist in the current context build error. This should be covered by the DLL
Screenshots of the import settings:

It is recommended to try to build with unity2017. I built the unity project in repository with unity2017.4.31f1 and it seemed to work fine.
Update:
I used 2018.4.3 to create a new project and did some simple tests, this error was not thrown after using such a Import Setting.

Related

JsReport using C# .NET core and Vs

I am trying to learn JsReport using c# and .NET core and visual studio. I have installed the required nuget packages (jsreport.binary and jsreport.Local). I am trying to replicate the code found Here. The problem is that I keep getting the following error.
***Severity Code Description Project File Line Suppression State
Error MSB3021 Unable to copy file "C:\Users\jmodiba\source\repos\js\js\obj\Debug\net6.0\apphost.exe" to "bin\Debug\net6.0\js.exe". Access to the path 'bin\Debug\net6.0\js.exe' is denied. js C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 5097***
here is the code,
using jsreport.Binary;
using jsreport.Local;
using jsreport.Types;
var rs = new LocalReporting().UseBinary(JsReportBinary.GetBinary()).AsUtility().Create();
await rs.RenderAsync(new RenderRequest()
{
Template = new Template()
{
Recipe = Recipe.ChromePdf,
Engine = Engine.None,
Content = "Hello from pdf"
}
});
I managed to find the problem. My antivirus kept on moving the .exe file created to quarantine. Once I created an exception in the antivirus setting my code ran correctly.

ML.NET: strange runtime error on some machines

I wrote a simple UWP app using the ML.NET framework, and it worked on one of my machines without installing any Nuget packages, without any additional setup etc.
However, on my other machine, after running the application, I get this error:
System.Runtime.InteropServices.COMException: 'Unspecified error
No suitable kernel definition found for op Sub (node Minus675)'
The error happens in this segment of code:
public static async Task<modelModel> CreateFromStreamAsync(IRandomAccessStreamReference stream)
{
modelModel learningModel = new modelModel();
learningModel.model = await LearningModel.LoadFromStreamAsync(stream);
learningModel.session = new LearningModelSession(learningModel.model); // it breaks here
learningModel.binding = new LearningModelBinding(learningModel.session);
return learningModel;
}
In case anyone should ask - yes I have added my .onnx model in the Assets folder. My configuration is: VS 2017, Windows 10 version 1809, build 17763.194, and I have Windows 10 SDK version 10.0.17763.132. I have tried installing the Visual Studio Tools for AI and ML.NET Templates VS extensions, but it didn't help.

System.typeloadException while running VS code

I am a beginner in software development. I was following a simple tutorial and was creating a web application in Asp.net MVC - 5. But suddenly my app stopped running even I did not do any fancy stuff. Below is the error I am getting. Please help me here.
Error: System.typeloadexception.
Additional: Microsoft,Ajax.Utilities.OutputVisitor from assembly 'WebGrease'
I have not touched these fancy stuff at all. But as soon as I run the application in local host I start getting this error. Error comes in _Layout.cshtml file near the line
#Scripts.Render("~/bundles/modernizr")
This can happen if your targeted .Net framework version not installed on your System. Check your project properties .Net version and check your Pc has respective .Net installed.
try
{
}
catch (TypeLoadException)
{
// this can happen if respective .Net is not installed in your system
}
TypeLoadException is thrown when the common language runtime cannot
find the assembly, the type within the assembly, or cannot load the
type.
or add this code snippet
AppDomain.CurrentDomain.AsemblyResolve += (s, e) =>
{
return AppDomain.CurrentDomain.GetAssemblies()
.SingleOrDefault(asm => asm.FullName == e.Name);
}
If all attempts fails, try to reinstall WebGrease nugget package

Error MCG0004:InternalAssert Assert Failed when building UWP app in release mode

I have an UWP app written in C# which builds (VS 14.0.25425.01 Update 3 on Windows 10.0.14393, target version of the project is build 14393) and runs in Debug mode, but fails to build in Release mode with the following error:
Microsoft.NetNative.targets(640,5): error : MCG0004:InternalAssert Assert Failed: field not found during [UNKNOWN]
There are no further details, except for two warnings before, which I am not sure whether they are related to the problem:
Resources.System.Linq.Expressions.rd.xml(35): warning : ILTransform : warning ILT0027: Method 'CreateLambda' within 'System.Linq.Expressions.Expression' could not be found.
Resources.System.Linq.Expressions.rd.xml(91): warning : ILTransform : warning ILT0027: Method 'ParameterIsAssignable' within 'System.Linq.Expressions.Expression' could not be found.
Any suggestions what the issue could be related to?
This error will occur if you're using the Beta package for .NET UWP tools with VS 2015. The Beta package is only supported on 2017 as there are changes to how deployment/debugging work that we rely on. You should be able to avoid the issue by downgrading from "Microsoft.NETCore.UniversalWindowsPlatform": "5.3.0-beta2" to "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2"
edit: 5.3.0 has been published and works with VS2017 RC3+. More information here: https://blogs.msdn.microsoft.com/dotnet/2017/01/30/announcing-net-core-net-native-and-nuget-updates-in-vs-2017-rc/
Disclaimer: I work on the .NET Native compiler+runtime team.

Calling local SSIS package from C# console application

I'm trying to run a local SSIS package from a C# console application. I've built both the package and the application using .Net 4.5.1 in VisualStudio 2012. When I say "local" I mean the SSIS package hasn't been deployed to a SQL Server; I'm just trying to call the .dtsx file from the file system. The SSIS package runs fine from within VisualStudio. Here's my code:
string pkgLocation = #"C:\Users\06717\Documents\Visual Studio 2012\Projects\RMA_Data_Cleanup\RMA_Data_Cleanup\";
string pkgName = "Package.dtsx";
Application app = new Application();
Package pkg = new Package();
DTSExecResult pkgResults = new DTSExecResult();
try
{
pkg = app.LoadPackage(pkgLocation + pkgName, null);
There's more after this, obviously, but the problem comes with the app.LoadPackage line. When I try to run it, this exception gets thrown:
The package failed to load due to error 0xC0011008 "Error loading from XML. No further detailed error information can be specified for this problem because no Events object was passed where detailed error information can be stored.". This occurs when CPackage::LoadFromXML fails.
I've googled this error message, and I haven't found anything that seems to apply to my case. One thing that occurs to me is that maybe I'm calling the wrong dtsx file. There's another one in the obj\Development folder. I've tried calling that one too, but I get the same exception. Am I calling the right file? Is there something I need to do from within Visual Studio, other than build the package, before I can do this? (pkgResults = Success, BTW)

Categories

Resources