'DJI.WindowsSDK.DJISDKManager' threw an exception - dji-sdk

I recently downloaded the most recent DJI Windows SDK (2.0) in hopes to update my DLLs and be able to move forward with the new SDK. I can build the project but when I try to execute my app, it errors with the following:
'DJI.WindowsSDK.DJISDKManager' threw an exception. - Inner Exception.
FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
I've re-pulled the repo, using both Visual Studio 2017 and the 2019 Preview, I then tried the sample SDK and got the same error. I'm currently on Windows Build 17763.292. Is there something I'm missing? Anyone else with similar issues?
Thanks!

First thing to check is your references; here's mine from a working project:
Solution References
Note my project uses JSON, so you may ignore the Newtonsoft NUGET. Also note the DJIWindowsWrapper reference is to the winmd file. Your project will probably build fine without this reference (mine does), but won't run.

Related

Visual Studio 2019 WinUI 3 Duplicate entry error

Error PRI175: 0x80073b0f - Processing Resources failed with error: Duplicate entry. MyApplication (Package) C:\MyApplication (Package)\GENERATEPROJECTPRIFILE
<- This is the error I always get if I want to compile my .NET 5 WinUI 3 (0.8.1) Desktop Packaged Project.
Either on the Packaging Project or on the main Application Project.
And bevor this error ther is always this error:
Error PRI222: 0x80073b0f - Unspecified error occurred. MyApplication (Package) C:\MyApplication (Package)\GENERATEPROJECTPRIFILE
On the internet, I couldn't find any solution.
Can please somebody help?
Some additional info:
I have the latest version of Visual Studio Community (16.10.3)
I also have the latest version of my Project Reunion/Windows App SDK NuGet packages (0.8.1)
... and each other NuGet is also up to date
My C# application uses some [DllImport] and [ComImport]
I also use the PInvoke from Microsoft's CsWin32 project
I tried to create a new project and copy code file content by file content into new files but it does not help.
I had the same error, what I did was to remove all the images from the assets and it worked, then I was adding little by little until I found the assets that gave error.
I understand that the error is generic, VS does not help much.

Debug and build web success but publish fail visual 2019

I'm using visual 2019, ASP.NET MVC core 2.2.0
My project debug ok, build no error but when I publish it give me an error like this
Detail file in AppData\Local\Temp\tmp76C2.tmp
System.AggregateException: One or more errors occurred. --->
Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed.
Check the Output window for more details. --- End of inner
exception stack trace ---
---> (Inner Exception #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed.
Check the Output window for more details.<---
Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed.
Check the Output window for more details.
How can I fix it?
Check out the output window of visual studio when publishing, read all lines to find any error, then fix it. For example it might be a problem for copying files to publish folder after building. So you won't get any error on build as well.
Look for something like this:
I ran into this error in VS 2019/Core 3.1. In my case, the Publish displayed a bunch of errors with the Bundler, which a regular build didn't show. Eventually found the Web Publish Activity window gave a clue: it shows line numbers for errors it finds, and the first error with the Bundler there was the problem, apparently. Turned out it didn't like an async function in the JS file. I removed that and it published OK.
For me the problem was that I updated de .net core version (2.2 to 5) of my project and forgot to change the .net version target on my publish profile.
Update Microsoft.Net.Compilers package.
I have also encountered this problem when I was going to publish my API.After that, I found my publishing folder does not exist in my local PC.
It could also be due to a problem with the signature in your deployment options. Make sure to select a valid certificate.
I encountered this problem in Visual Studio 2022 when try to publish Blazor project. I tried many things (Clean, Rebuild, clear Nuget Cache etc) but nothing worked. Finally I used this command on the solution folder with Powershell (run as Admin)
dotnet workload install wasm-tools
Then I reopened Visual Studio and publish worked
This may be helpful for someone else.
I got below error while publishing the code.
Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.
We upgraded .Net core 5.0 to 6.0 (VS 2022) and trying to provide new build to higher environments.
After spending little time around the error in output window and logs (published by Visual Studio) i found publish profile(FolderProfile.pubxml) of our project is targeting to .Net 5.0 where is our project now upgraded to .NET 6.0 hence the publish was unsuccessful.
Modified tag in FolderProfile.pubxml
<TargetFramework>net6.0</TargetFramework>

The "LinkAssemblies" task failed unexpectedly - SB4018: System.IO.FileNotFoundException

Last week I quite suddenly got this error while building Xamarin.Android for release. Last time I built the project for release everything worked fine.
The projects builds when I choose to link no assemblies, but when I use “Link SDK assemblies only” it fails. And it fails across every branch I have. I have tried to build my master-branch that has not changed since before last time i worked, and that also fails now.
I have also tried to delete bin & obj and checked Android versions and that packages match
Visual Studio is updated, and also have re-installed it, also re-installed Xamarin and Android SDK.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2145,5): error MSB4018: The "LinkAssemblies" task failed unexpectedly
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamrin.Android.Common.targets(2145,5): error MSB4018: System.IO.FileNotFoundException: Could not load assembly ‘ProjectName.Droid, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
Update
I've got an answer from a Xamarin.Android contributor who explained what has happened to the build process.
The "SignAndroidPackage" MSBuild target no longer depends on the "Build" target so, I think, it implicates if an Android project has "DefaultTargets" set to only "SignAndroidPackage" then this target won't be able to find the project compiled DLL since it was not built.
Thus I assume that this is why we have "LinkAssemblies" task failed.
To resolve the error I've added the "Build" target just before "SignAndroidPackage".
Old comment
I've faced the same error in my project after migrating to Visual Studio 2019.
Everything is fine in Visual Studio 2017 and Visual Studio for Mac. Thus I presumed that it might be a bug and raised an issue on GitHub.
We may both follow it here: https://github.com/xamarin/xamarin-android/issues/3715
The solution was to remove <RunCodeAnalysis>true</RunCodeAnalysis> from the android.csproj-file. The problem was that the linker tried linkage before the packages got prepared for linking.

Installing VS 2015 Community edition makes VS 2013 to throw errors

I have downloaded and installed the free Community Edition of VS 2015 from Microsoft. After the install, I am unable to use VS 2013 Professional, which was working fine before the install. The start page shows, "Content Load Error". The solution explorer shows the following errors:
An exception was encountered while constructing the content of this frame. This information is also logged in "C:\Users\VeluMain\AppData\Roaming\Microsoft\VisualStudio\12.0\ActivityLog.xml".
Exception details:
System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at Microsoft.VisualStudio.Shell.Interop.IVsShell5.LoadPackageWithContext(Guid& packageGuid, Int32 reason, Guid& context)
at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.GetPackage()
at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()
I searched in Google, but couldn't find any solution.
Thanks
It's possible that one of your plugins for VS2013 has been broken by the VS2015 installer. For example I had an issue where VS2015 installer also installed .NET Framework 4.6 which alters the .NET Framework 4.5.1 DLLs, I guess there's a chance it could be the same kind of thing...
Try running VS2013 in Safe Mode (i.e. without plugins). If this works fine then you know it's one of your plugins that is causing the issue, you should then use a process of elimination to determine which one is the culprit. If it doesn't work then you might want to reinstall VS2013.

"Exception has been thrown by the target of an invocation." when building a Visual Studio 2010 VSPackage

I recently create a couple of VSPackages for some Visual Studio extensions (menu bar/command). I compiled them correctly yesterday, checked into TFS (i'm the only one touching this project, FYI). I had already installed these extensions and were working fine. Today it doesn't compile! I get the following error:
Exception has been thrown by the target of an invocation.
This doesn't tell me anything, so i fired up Visual Studio with the following command:
devenv.exe /Rebuild > out.log
In my out.log, I see the following:
C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets(420,5): error : Exception has been thrown by the target of an invocation.
I have been stuck on this for hours and can no longer build these VSPackages. Anyone? This is really frustrating. I have already tried cleaning project/rebuilding/build using Visual Studio itself (not command line)
I've experienced this issue several times in both vs2010 and vs2012, and manually deleting the "bin" and "obj" folders from the project then doing a "rebuild" normally does the trick.
Further to the answer provided by the OP, I will provide it here for completeness instead of relying on the external link remaining live:
Quoted directly from the MSDN forum answer:
Do you happen to have these extensions installed to the AllUsers
location (i.e. %VSInstallDir%\Common7\IDE\Extensions)?
You mentioned in your initial post that "I had already installed these
extensions and were working fine."
The task that's failing (based on the line number in the targets file)
is the UninstallExtension task. The only reason I'm thinking this task
would execute and fail in your situation is if you're building an
extension that's already installed to the Common7\IDE\Extensions
directory.
Regards, Aaron
I find myself on this question because of exactly the same build issue of a VSIX Installer Project for our project templates. This solved my issue.
Indeed, I uninstalled the prior version of our templates and the build occurs without issue.
Have you double checked that all of your projects are using compatible framework versions?
As in you can't use a .Net 4.0 assembly in a .Net 3.5 project.
Is the project linked with source control like TFS? If so then take latest from TFS and try again.
Are you running Visual Studio as Administrator?
Maybe you have insufficient rights for some file (copy/move/delete) especially in bin or obj folders.

Resources