No assembly found to analyze. NDepend will only analyze assemblies with PDB files generated - ndepend

NDepend version :NDepend Azure DevOps/ TFS extension.
I try to add some setting to analyse every .NET solution to show report on TFS website.
The build process shows some message.It looks like my project lose some file or my PDB file go wrong?
Can anyone help me? I feel confused.
error message:
No assembly found to analyze. NDepend will only analyze assemblies
with PDB files generated. NDepend gathers a lot of data from PDB files
(please read the documentation
http://www.ndepend.com/docs/ndepend-analysis-inputs-explanation ). If
you still wish to analyze assemblies that don't have PDB files you can
specify the assemblies from the NDepend project (.ndproj file), and
check the task option 'Analyse Only the Assemblies referenced from the
ndproj'

It appears that no PDB files are generated for your assemblies. Could you contact
the NDepend support team at devops#ndepend.com, they will help you make it works.

Related

CRM could not load file or assembly to my project

I added a reference itextsharp.dll to my plugins project, when running my plugins using plugin-registration tool I get this exception:
Could not load file or assembly or one of its dependencies. The system
cannot find the file specified
I tried removing the ref and adding it again, cleaning and then adding it to my project from different places.
Is there restrictions in plugin registration tool about adding non crm dlls? why ? how to solve it?
This is not going to work - you cannot reference external assemblies from CRM plugins that are registered in database. If you want to do this, you will have to merge your external dll with your plugin assembly. You have to remember that adding assembly as reference is not automatically making your referenced assembly available for your base assembly, therefore if you register your plugin assembly in CRM, system is not going to "magically" find somewhere your external assembly (in your case - "itextsharp.dll"). If this is not Online system, you can add your assembly to GAC, or register all your assemblies on Disk instead of database (not recommended approach). If you want to register them in database, you will have to merge everything in one assembly using ILMerge for example.
You can't reference something in a plugin unless it's in the bin of the CRM.
To make it work you need to ILmerge your reference with the plugin. Install this package in your project: MSBuild.ILMerge.Task. Then build. It will work instantly. The package will merge everything in the bin after the build. So make sure every other references are marked "Copy Local = false". Otherwise, you'll have a crazy big assembly.
Finally, Microsoft released a solution for this. You can build a nupgk file and register dependent assemblies.
Here are the white paper and my post about this;
Microsoft : Microsoft White Paper
My summary: Here is the link

Visual Studio Online cannot build project due to Entity Framework reference cannot be resolved

What can I do to fix this build? Entity Framework was added to this project via NuGet.
All projects compile without issues on local system. But the build fails on Visual Studio Online.
By turning on Diagnostic logging, I am able to trace to this warning which makes my builds failed:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "EntityFramework.SqlServer". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
DO NOT right-click the project and chose "Enable NuGet Package Restore". This is the "old way" of doing package restores as per the Nuget Docs.
Package restoration should happen as part of the build process by default. If it's not (which seems to be the case), you've got a different problem, but there's not enough information to say what.
I am able to resolve this error simply by right clicking at the solution in Solution Explorer and select Enable NuGet Package Restore.
That adds a few more files to my solution and modify a few project files. The build server can then restore the packages at build time and is happy in the end.

NuGet pack is not packaging all files in the output directory. What am I missing?

I'm trying to create a NuGet package from a .csproj. I have successfully compiled the project and the output folder contains all of the necessary files (my assembly and all of its dependencies). However, NuGet only seems to be placing the assembly created by the .csproj into the package and not any of its dependencies. My command line looks like this:
nuget pack MyProject.csproj -Property Configuration=Release
and my resulting .nupkg file only has my assembly in the lib folder. I have successfully gotten NuGet to work for other projects, but it just so happens that this project is referencing the Enterprise Library logging block, but it was NOT retrieved via NuGet. I'm not sure if that could be related to my problem or not.
Any thoughts on why it's not picking up the dependenices?
If you need to keep your nuspec file up-to-date automatically, its really just an XML file (as I'm sure you know) so there are some very nice tools you can use from MSBuild to automate nuspec creation/updates. Out of the box, MSBuild provides a few tasks that can update or transform XML, and I've used MSBuild Community Tasks to customize the initial nuspec. For example, the default nuspec contains a few lines with broilerplate that I don't need, so I use XmlUpdate tasks to delete them.
Although I have not looked into scanning the csproj file for non-nuget references, I think its likely possible with a little research. Here are some links to blog entries describing my experiences with NuGet automation, they may help you get a head start:
Creating Packages with NuGet the MSBuild Way - This article includes some basic NuSpec updates because the package described is not that different from the type of package NuGet already knows how to automate.
Manage Your MEF Parts With Nuget - This article includes some more complex updates to support distributing MEF parts as runtime-only references.
If you plan on doing this alot, don't want to mess with MSBuild, or just want to get back the behavior you liked from the pre-1360 version of ProjectFactory.cs, NuGet supports third-party extension through MEF. You could go into the source control and grab the earlier code that you liked and create a custom command (for example custompack) that provides that behavior. Then you could use it from the command line like so:
nuget custompack MyProject.csproj -Property Configuration=Release
I think this is a really cool aspect of NuGet but I haven't played with it myself yet. Here is an article that explains how to do it:
Extend NuGet Command Line
So even though David mentioned that NuGet is not designed to support this scenario, if the scenario is correct for you then you can go this route to extend NuGet to meet your needs.

FileNotFoundException when running NUnit tests from TeamCity

I am using the built in TeamCity NUnit runner to run tests stored in .DLL files.
My .DLLs are referencing other DLLs which are present in the same folder.
When running these, i am getting a FileNotFoundException for the referenced DLLs.
How can i fix this? I am thinking perhaps the TC NUnit runner is using some other dir as the main app execution folder, and thus preventing from files that are actually residing next to the test DLL to not load properly, but cannot prove this claim yet...
Anyone else encountered this behaviour?
OK the problem is solved and it is indeed silly and embarrassing:
I have set the NUnit test runner to execute these tests:
**/*.Tests.dll
This means that it will include tests from /bin/Debug/ and also from other folders, such as obj/
In these folders, no references are included of course, making the same tests run twice and some of these fail of course!
Paths are related to build checkout directory, not to any working directory. If you need another paths, use %reference% syntax to refer to TeamCity property with a directory path. Do you run it under Windows? Do you use TeamCity 6.5?
If that does not help, feed free to contact teamcity-feedback#jetbrains.com
In my case, the missing DLL was a native library and it could not be loaded because there was an incorrect version of VC runtime installed on the build agent. My solution was to add runtime DLLs (located in 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\redist\x86\Microsoft.VC110.CRT') directly into the project (build action = Content, copy to output directory = Copy always). This also makes installation friendlier.
Hope this helps.

NDepend cannot pick up new reference assembly automatically

I have a NDepend project that is using in automatic build process. When a developer adds one more assembly to the project, NDepend cannot pick up and analyze that assembly automatically. I can see the new assembly only when I add manually into NDepend project. How can I configure in NDepend project so that it will pick up new reference assembly and analyze automatically. Is there anyways to do it or am I something wrong in using NDepend?
Thanks,
ant.
When a developer adds one more assembly to the project,
I guess you mean When a developer adds one more assembly to the Visual Studio solution,
in that case indeed, this is a feature request for future NDepend version.