I'm making a Windows universal application 10, but when I build my solution, I've this error whit an inner exception.
The "GenerateResource" task failed unexpectedly.
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Build.Tasks.ResGenDependencies.TryGetPortableLibraryInfo(String libraryPath)
at Microsoft.Build.Tasks.GenerateResource.GetResourcesToProcess(List1& inputsToProcess, List1& outputsToProcess, List`1& cachedOutputFiles)
at Microsoft.Build.Tasks.GenerateResource.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
What does it mean? I've no information about whit file or line I had this.
I use Visual Studio Professional 2015.
Download and install the Visual Studio 2015 Update 1.
https://www.visualstudio.com/en-us/news/vs2015-update1-vs.aspx
That solved the issue for me.
Related
I have an app made with Xamarin Forms, that uses Akavache to cache data.
The app works well on iOS and Android in debug mode when I make a build with VS2019
But when I installed VS2022 and decided to make a build for android, an error occurred.
This error only occurs after I build and deploy the app with VS 2022. Nothing else was changed in the project.
Here is the error:
[AppCenterCrashes] Unhandled Exception from source=AndroidEnvironment
[AppCenterCrashes] System.MissingMethodException: Method not found: System.ReadOnlySpan1<byte> SQLitePCL.raw.sqlite3_column_blob(SQLitePCL.sqlite3_stmt,int) [AppCenterCrashes] at Akavache.Sqlite3.SqliteOperationQueue.MarshalCompletion[T] (System.Object completion, System.Func1[TResult] block, System.IObservable`1[T] commitResult) [0x00012] in D:\a\Akavache\Akavache\src\Akavache.Sqlite3\Queues\OperationQueue.cs:488
[AppCenterCrashes] --- End of stack trace from previous location where exception was thrown ---
Unable to deploy to Azure App Service. What might be possibly going wrong here?
10-10-2021 11:07:06
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.
===================
I'm using Visual studio 2022 Preview.
I tried this solution earlier, but this didn't work in my case, this was actually due to partially deleted publish profile under the properties folder.
So completely clearing (leaving launchSettings.json intact) that and adding profile again helped me resolve this issue.
tl;dr Q. "how do we successfully deploy [unmanaged library] libzmq to load dynamically to support 'ZeroMQ CLR namespace' being used in a C# program?"
C# code with NuGet pkg ZeroMQ 4.1.0.17 (Runtime version v4.0.30319; Version 4.1.0.42169) installed. Works just fine running in the Visual Studio workspace but when deployed with the .exe in the same directory as the ZeroMQ.dll and with an amd64 subdirectory containing both libzmq.dll and libsodium.dll -- and even with copies of both those copied up into the same exec directory as program and ZeroMQ.dll -- we get:
Connect System.TypeInitializationException: The type initializer for 'ZeroMQ.lib.zmq' threw an exception. ---> System.IO.FileNotFoundException: UnmanagedLibrary[libzmq] Unable to load library "libzmq" from "C:\Windows\TEMP\libzmq.dll". Inspect Trace output for details. ---> System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
--- End of inner exception stack trace ---
at ZeroMQ.lib.Platform.Win32.LoadUnmanagedLibrary(String libraryName)
at ZeroMQ.lib.zmq..cctor()
--- End of inner exception stack trace ---
at ZeroMQ.ZContext..ctor()
at Core.Adapter.ZeroMQ.ZeroMQMessagingService.Connect(String connection_string) in \ZeroMQMessagingService.cs:line 201
Note that is says it is looking in C:\Windows\TEMP but maybe that is only the last place in a chain.
We're getting this after upgrading to ZeroMQ 4.1.0.21 and failing to load the libzmq.dll as an "embedded resource", so we removed .21 completely and returned to .17. It had been working fine in .17 before we upgraded to .21.
Copy If Newer is checked on the amd64\libzmq.dll and libsodium.dll and, yes, this is an x64 build attempting to run on an x64 machine. The failing host is 2012 Server running .NET 4.5.
This turned out to be very simple. We are moving to a new machine still being configured and installing the C++ 2010 redistributable solved the problem for us.
I'm using the latest version of PostSharp (version 4.1.31.0) in a C# solution with Visual Studio 2015 (with update 1).
Everytime I try to build the solution I get the following error:
Unhandled exception (4.1.31.0, postsharp.srv.4.0-x86.exe, CLR 4.0.30319.394271, Release): System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
I've switched on detailed output when building but haven't been able to spot anything in the output so far!
I have other solutions that work fine with this version so I suspect it is something to do with the solution's configuration.
As an aside, I have also tried version 4.1.30 and get exactly the same error.
Any help or advice on where to look would be greatly appreciated.
So to solve my issue all I had to do was to set the PostSharp 'Processor Architecture' option in the project properties to x64 for the project that includes my aspects.
I'm not exactly sure why but my application builds and runs without issues.
Had the same issue, PostSharp crashing at compile time:
Severity Code Description Project File Line Suppression State
Error An unexpected exception occurred when executing user code: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
at System.Reflection.RuntimeMethodInfo.GetParameters()
at PostSharp.Patterns.Model.NotifyPropertyChanged.DependencyAnalysis.InpcMemberAnalysis.IsInpcIgnoredProperty(PropertyInfo property)
at PostSharp.Patterns.Model.NotifyPropertyChangedAttribute.<>c.<GetNotifiableProperties>b__48_0(PropertyInfo p)
at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext()
at PostSharp.Patterns.Model.NotifyPropertyChangedAttribute.GetNotifiableProperties(Type type, Boolean excludeExplicitProperties, Boolean& hasExplicitProperties)
at PostSharp.Patterns.Model.NotifyPropertyChangedAttribute.CompileTimeInitialize(Type type, AspectInfo aspectInfo)
at PostSharp.Sdk.AspectWeaver.AspectWeavers.TypeLevelAspectWeaverInstance.^gAHJKdyo.^WnalpwzH()
at PostSharp.Sdk.Utilities.ExceptionHelper.ExecuteUserCode(MessageLocation messageLocation, Action userCode, Type[] acceptableExceptions). Avalon.Dock.Measurements
Solved it by killing the process PostSharp Compile service (something like this) from the task manager.
So a webapp I've been working on broke, and I made some fixes... it still crashes, but in the YSOD it shows me the old code. I'm running this from the VS 2005 IDE. It won't hit any breakpoints, and it crashes on line 249, which is clearly commented out. I've cleared out my debug/release folders and rebuilt it; restarted IIS (just in case); what would cause this?
Could not find file 'c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\map.xml'.
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: System.IO.FileNotFoundException: Could not find file 'c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\map.xml'.
Source Error:
Line 248: //XmlDocument xMap = new XmlDocument();
Line 249: //xMap.Load(MapPath("map.xml"));
The current code probably did not compile, therefore the metadata in the DLL is for your old code.