How to enable Full StackTraces in Unity 2021 - c#

Today I got the message "A Native Collection has not been disposed, resulting in a memory leak. Enable Full StackTraces..." How can I enable it in Unity 2021.3.18f?
All I know it should be enabled from "Jobs" menu, but full stack traces option is missing. I need to install some package from package manager which is also not available.
Any advise/clue will be highly appreciated.

After some research it came out that "Jobs" menu is available in all Unity versions except 2021...
To install "Jobs", load following package "com.unity.jobs" from package manager via "Add package by name"

Related

Nuget package verification is taking too long on a build machine

I have a build step in my CI pipeline where I restore the NuGet packages for my solution. I am retrieving my NuGet packages from a NuGet hosted repository on Sonatype Nexus. The package restore itself is running smooth enough, but it hangs in a step where it takes almost 2 to 3 minutes to verify some packages(in this case packages provided by Microsoft). The build agent where I have this restore done does not have internet access. And that's why I am also using a NuGet proxy on my Sonatype Nexus.
For example the step that it gets hanged on is:
PackageSignatureVerificationLog: PackageIdentity:
Microsoft.Owin.3.1.0 Source: ...nuget\packages\
PackageSignatureValidity: True
I have considered adding a list of trusted-signers to the nuget configuration of my builds. But since my machine does not have internet access, this wouldn't be very helpful. As described in the Microsoft documentation:
https://learn.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-trusted-signers
As described in the https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file
I also tried setting the signitureValidationMode to <add key="signatureValidationMode" value="accept" /> which in this case will verify the packages by default. Even though this is the default case, and accepts them if it does not succeeds to connect. But this does not change the speed of my NuGet restore.
Besides opening up network access for all the NuGet verification URLs my solution would need.
Is there a way that I can set the NuGet configuration to not verify the certificates of the NuGet packages in an offline mode for my build agent?
After some digging around I found the following Microsoft document.
Which explains the possible slow down issue that might occur on an offline machine(such as a build agent) and a possible solution.
The issue can be resolved by implementing the Environment variable NUGET_CERT_REVOCATION_MODE to offline.
NUGET_CERT_REVOCATION_MODE = 'offline'
In a tool as Jenkins, you can declare it in the environment variables, or you can run a command on the build machine to set the environment variable.

How to package and deploy a NuGet package with symbols and source code so that debugger can use THAT source code?

I have created a very simple NuGet package from a .net framework visual studio Class Library project, where the class library source is in C#.
I used this command to create the nuget package:
nuget pack MyProject.csproj -symbols -Properties "Configuration=Debug" -suffix debug
Which creates, as I expect, two nuget package file, namely:
MyProject.1.0.0-debug.symbols.nupkg
MyProject.1.0.0-debug.nupkg
These packages are basically identical other than that the one with "symbols" includes the pdb files in the lib hierarchy and source files in the src folder.
Given the duplication, I rename the file MyProject.1.0.0-debug.symbols.nupkg as MyProject.1.0.0-debug.nupkg, which overwrites one of the files, no big deal there. I now have a conventionally named package with PDB and source files in it.
I deploy this to an internal file share feed with:
nuget add MyProject.1.0.0-debug.nupkg \\InternalShare\FeedFolder
In an entirely different project, and a different solution, I now consume that NuGet package in Visual Studio with the NuGet Package Manager. All works great. And the code works fine too, in my case I made a simple console app that uses a couple of classes in the package and I have demonstrated that it uses them correctly and without incident.
So far so good.
Now I set a breakpoint in the consuming code, and attempt to step into the source to debug the package. It seems to work OK, but actually, it isn't going into the source that was distributed with the package. It actually steps into the ORIGINAL source from the creation of the package, in a completely different and unrelated folder hierarchy on my machine.
OK. So now I recreate my simple console app on a separate computer that does not have the ORIGINAL source. And on that separate computer, which is on the internal network and hence has access to the file share, I consume the NuGet package and again, everything compiles and works fine.
When I try to step into the package source code in the visual studio debugger, however, it simply doesn't work. The debugger can't find the source code even though it is right there in the package folder. (The debugger offers to disassemble the code -- not so helpful).
This seems like it should be a common use case and desire for including symbols and source code in a nuget package, so I must be doing something silly such that the debugger can't find the source.
Various versions of things:
Visual Studio: Professional 2017 15.9.11
NuGet Package Manager installed in VS: 4.6.0
CLI NuGet version: 4.8.1.5435
Targetted .NET Framework for my sample code: 4.6.1
What is my mistake?
Many thanks in advance.
================== ADDED INFO 4/17/2019, 3:30pm Pacific =======================
This isn't quite as bad as I thought. When I try to go into the code and says it can't find it, I am given the opportunity to browse to the code, so I can browse to the package (assuming I know where it is!) and set the debugger loose and everything works fine. The nice thing is that Visual Studio seems to remember where I browsed to and knows to look there next time. Not sure of that mechanism.
AND.... If I go to my original computer (with the actual package source on it) if I change that initial source, like I am getting ready for the next package, the debugger (of course) realizes that the source has changed, and likewise prompts me to look for the proper source elsewhere.
Still, it would be great not to have to jump through hoops like that, so I would still appreciate any further insights.
Back in Feb'2019 it was working. Few things which are not mentioned here and I added to csproj file are
<DebugSymbols>true</DebugSymbols>
<EmbedAllSources>true</EmbedAllSources>
<DebugType>portable</DebugType>
I packaged with nuget and command used is:
nuget pack mynuget.nuspec -Symbols -SymbolPackageFormat snupkg
I was using VS 15.9.4 and nuget 4.9.3 at that time With this I could successfully debug nuget from network path . Not sure what changed in recent releases, its not working now.
Some fundamentals:
the debugger needs PDBs to enable debugging
a symbol package should contain PDBs (it is not merely a package with a different extension)
this symbol package should be published to a symbol repository that Visual Studio debugger can request symbols from
Next:
See this doc for creating and publishing symbols package to nuget.org (.snupkg)
Then, see this doc for configuring visual studio to for using NuGet.org as a symbol source (use this value when adding a symbol server https://symbols.nuget.org/download/symbols)

Resource.Designer.cs: "Resource ... does not contain a definition for ..."

today I updated the NuGet packages for our Android version (we are currently developing for Android and iOS).
After the updates I cannot build the Android version anymore. This is an issue I faced everytime after updating packes so far, but this time I can't solve this problem.
Usually restarting Xamarin or Reinstalling the NuGet packages helped.
I have 151 error messages like this one:
/Users/Username/Projects/MyAppName/Droid/Resources/Resource.designer.cs(118,118):
Error CS0117: >MyAppName.Droid.Resource.Attribute' does not contain a
definition for mediaRouteSettingsDrawable' (CS0117) (MyAppName.Droid)
Here are all the steps I already did trying to fix this problem (in this order):
Build --> Clean all
Uninstall every NuGet package from every project (Droid, iOS, SyncLibrary (own library for SQL server communication) and UITest)
Delete everything inside of file "Resource.Designer.cs"
Close Xamarin
Install every package in the SDK Manager for every version
Delete the packages folder of the solution
Delete content of /Users/Username/.local/share/Xamarin
Delete content of /Users/Username/.local/share/NuGet/cache
Start Xamarin
Add Newtonsoft.Json package to SyncLibrary
Add Android packages: only add the needed packages, let NuGet resolve dependencies (like Xamarin.Android.Support, Xamarin.GooglePlayServices etc.) on its own.
Installed packages (in this order):
Xamarin.Forms.......................................(2.2.0.45)
Xamarin.Forms.Maps...........................(2.2.0.45)
XLabs.Forms............................................(2.0.5782)
ZXing.Net.Mobile..................................(2.0.4.46)
Newtonsoft.Json....................................(8.0.3)
Xam.Plugin.Geolocator........................(3.0.4)
Build --> Clean all
Restart Xamarin
Build new: SyncLibrary (so there's no dependency error when trying to build the Android version)
Build new: Android version --> Error
I really don't know what to do anymore.
Any help / ideas are appreciated, thanks in advance.
Xamarin.Forms...(2.2.0.45)
XLabs.Forms.....(2.0.5782)
That's the point. The last stable Xamarin.Forms has some problems that may cause build errors when you're using XLabs or another library.
The only solution which I know is to use pre-release version of XLabs.Forms - 2.2.0-pre02.
In my case I updated XLabs packages and cleared/rebuild my solutions.
More info in XLabs issue tracker and Xamarin Bugzilla.
I've experienced similar errors, but didn't use XLabs.Forms. I saw, that you used ZXing.Net.Mobile also, as me - I've updated that to newest pre-release (in the time of writing: 2.1.0-beta1) and it also helpep.
I have the same problem with mine Xamarin solution
have you tried:
Exit Visual Studio
Deleting c:\Users\username\AppData\Local\Xamarin
Open the solution again
Compile, wait until it finishes completely.
Anyway, found this link, maybe it was useful:
Xamarin: Build action EmbeddedResource

Documentation project type missing after NuGet Sandcastle Install

I have installed the most current version of Sandcastle from NuGet (EWSoftware.SHFB version 2015.10.10.0), and the needed Reflection package (EWSoftware.SHFB.NETFramework version 4.6).
I read #Frank-Rem answer to Numid's question How to generate documentation using Sandcastle NuGet package (EWSoftware.SHFB)? and tried to add a new project to my solution. However, when I try to add a Sandcastle Documentation project I do not have the Documentation project type as an option.
I uninstalled the NuGet package and reinstalled it, thinking it may have been a buggy install. But the documentation project type is still not an option, even after shutting Visual Studio down and relaunching it.
I read through the readme.txt file and saw that I will need to add some property tags to the .shfbproj file when it gets generated. Beyond that, I don't see any other steps that I need to perform or packages to install in order to get the project type to show up. I have also gone to the GitHub project page and checked the Issues tab to make sure this isn’t a known issue they are working on.
I am using Visual Studio Ultimate 2013.
Are there additional steps I need to take to get the Sandcastle project type to show up in the Add New Project list?
Thank you for any ideas!
I was able to resolve the issue by running the Sandcastle Help File Builder Guided Installer. This identified missing components and installed them.
I was then able to follow the instructions from #frank-rem on adding the documentation project and documentation source to the new project.
Assuming that you already have a solution with a project, add a new project of type 'Documentation' to your solution.
Right-click Documentation Sources and add a source by selecting the csproj you wish to document.
Then just build.
Additional steps I took to get a finalized help doc: I found that Sandcastle had added several TODO items, which didn't show up in the Visual Studio task list. So I did a search on the solution for TODO and resolved them that way.
After that I followed the instructions on adding the namespace summaries provided by #davy-landman (in a comment to Davy Landman's answer) to clear up some missing flags.
This has actually changed in the latest version (currently 1.9.3.0) to Project Properties > Summaries > NameSpaceSummaries. – Ant Swift Jan 6 '12 at 9:44

Visual studio stopped building projects. What to do?

I have a problem with visual studio 2010. It stopped building projects.
I had a problem with error:
Error occurred while restoring NuGet packages
I did Solution properties -> Enable NuGet Package Restore
And this result that build does not happen. If i click build or rebuild
all I get is:
------ Rebuild All started: Project: MyProject, Configuration: Debug Any CPU ------
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
I have tried:
- cleaning, rebuilding
- restarting VS
- rebooting
- Tools -> Options -> Projects and Solutions -> Build and Run and set MSBuild project build output verbosity to Normal, Detail, Diagnostic each with zero results. The only output is the one above.
It also finishes immediately, usualy it took some time. What is wrong here? How can I fix it?
UPDATE
I have tried command line build and in the output i find:
D:\MyProject.nuget\NuGet.targets(100,9): error : Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, publicKeyToken=b77a5c561934e089'.
It looks like nuget issue.
NuGet automatic package restore has changed in version 2.7+ see NuGet documentation for restoring packages and new approaches. Also take a look at common issues .
Without knowing all the information of your setup based on the documentation they advise to choose one approach to avoid problems.
Common issues with Automatic Package Restore
If you have Nuget 2.7+ installed; it's important to pick one method for managing Automatic Package Restore in Visual Studio.
Two methods are available:
(Nuget 2.7+): Visual Studio -> Tools -> Package Manager -> Package Manager Settings -> Enable Automatic Package Restore
(Nuget 2.6 and below) Right clicking on a solution and clicking "Enable Package Restore for this solution".
These are different methods; and have drastically different outcomes for developing with NuGet.
Otherwise look at not having NuGet perform an automatic package restore.
Update based on comment:
The error you are receiving does not give you a lot to work with except that their are known issues if you are using both approaches to restore packages.
Try a couple of things, so you can find the root cause of the problem and resume building your solution.
Delete your solution folder locally and get the latest from source
control or last known good build. If this is not an option then back up your solution and related folders and look at free version control solutions.
The suggestion to delete the packages folder was because NuGet will
not find the needed references and make an attempt to get the needed
references. Perhaps by deleting the packages folder it will give the
exact reference it cannot restore.
Verify the way your solution is using package restore and make sure
you are only doing one or the other based on the NuGet documentation
provided in the link above.
Test if you can build another solution that has NuGet or create a simple solution and add one to test.
If all else fails remove NuGet and add your references manually. Then
start adding back NuGet packages one at a time.
Try to delete the packages folder and rebuild.

Categories