FXCop assembly load failure - fxcop

Command line:
"C:\Program Files (x86)\Microsoft Fxcop 10.0\FxCopCmd.exe" /file:XXX.exe /out:fxcop-report.xml /outxsl:none /forceoutput /searchgac /assemblyCompareMode:StrongNameIgnoringVersion /verbose
Error from report:
<Type>Microsoft.FxCop.Common.AssemblyLoadException</Type>
<ExceptionMessage>Could not load XXX.</ExceptionMessage>
<InnerType>Microsoft.FxCop.Sdk.InvalidMetadataException</InnerType>
<InnerExceptionMessage>The following error was encountered while reading module 'XXX': Security attribute type does not have a default constructor: System.Security.Permissions.SecurityPermission.</InnerExceptionMessage>
Anyone any ideas?

Related

Build Failed directory does not exist

I am new to Ant and dynamic web project. I created a build.xml and copied it from here Tomcat example. I changed all the necessary directories.
But I still get an error.
This is the error message I get:
Buildfile: /Users/{myusername}/eclipse-workspace/JSF/build.xml
prepare:
compile:
[javac] Compiling 5 source files to /Users/{myusername}/eclipse-workspace/JSF/build/WEB-INF/classes
BUILD FAILED
/Users/{myusername}/eclipse-workspace/JSF/build.xml:67: /Users/{myusername}/eclipse-workspace/JSF/usr/local/Tomcat/bin does not exist.
Total time: 649 milliseconds
And this is the line where the error occurs
<javac includeantruntime="false" srcdir="${src.home}" destdir="${build.home}/WEB-INF/classes" debug="${compile.debug}" deprecation="${compile.deprecation}" optimize="${compile.optimize}">
but i don't get why
Can you help me?

MSBuild: 'error MSB6006: "cmd.exe" exited with code 1.'

When attempting to build TensorFlow with CMake and MSBuild on Windows 10, I get the following error when running MSBuild:
"C:\work\tensorflow\tensorflow\contrib\cmake\build\tf_tutorials_example_trainer.vcxproj" (default target) (1) ->
"C:\work\tensorflow\tensorflow\contrib\cmake\build\tf_core_gpu_kernels.vcxproj" (default target) (90) ->
(CustomBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1. [C:\work\tensorflow\tensorflow\contrib\cmake\build\tf_core_gpu_kernels.vcxproj]
351 Warning(s)
1 Error(s)
So I only get one error message, and that just tells me that cmd.exe was closed with an error code indicating that there was a problem, but not what the problem was. So how can I find out what caused this problem so I can solve it?
This error commonly happens because the default cmake install location requires admin privileges (normally C:/Program Files/).
There are two simple ways around this:
Run visual studio as Administrator
Override the CMAKE_INSTALL_PREFIX variable to point somewhere not requiring admin privileges
Personally, I'd recommend the second option (When configuring cmake, the command would be something like: cmake . -DCMAKE_INSTALL_PREFIX=D:/Some/Path)

Visual Studio Online test runner can't load SpecFlow dll

I've added SpecFlow using Nuget and have a single spec (so it is a simple project). I've created a build in VS online 2015 using the web build editor.
Maybe it's a Nuget new build system issue? I'm not sure if it just a SpecFlow thing and haven't gotten a chance try straight MS unit tests yet.
An exception occurred while invoking executor
'executor://mstestadapter/v1': Could not load file or assembly
'TechTalk.SpecFlow, Version=1.9.0.77, Culture=neutral,
PublicKeyToken=0778194805d6db41' or one of its dependencies. The
system cannot find the file specified.
Here's a larger stack trace:
1. 2015-08-03T21:26:27.6325511Z Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\tasks\VSTest\1.0.16\VSTest.ps1
2. 2015-08-03T21:26:28.4231183Z ##[debug]Calling Invoke-VSTest for all test assemblies
3. 2015-08-03T21:26:28.4481177Z Working folder: C:\a\14076a40
4. 2015-08-03T21:26:28.4481177Z Executing C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe "C:\a\14076a40\SpecByExample\SpecByExample.Specs\bin\Debug\SpecByExample.Specs.dll" "C:\a\14076a40\SpecByExample\SpecByExample.Specs\bin\Debug\SpecByExample.Specs.dll.config" "C:\a\14076a40\SpecByExample\SpecByExample.Specs\obj\Debug\SpecByExample.Specs.dll" /logger:trx
5. 2015-08-03T21:26:29.4654019Z Microsoft (R) Test Execution Command Line Tool Version 14.0.23107.0
6. 2015-08-03T21:26:29.4664025Z Copyright (c) Microsoft Corporation. All rights reserved.
7. 2015-08-03T21:26:29.4664025Z Starting test execution, please wait...
8. 2015-08-03T21:26:29.7564024Z Warning: Unable to load types from the test source 'C:\a\14076a40\SpecByExample\SpecByExample.Specs\obj\Debug\SpecByExample.Specs.dll'. Some or all of the tests in this source may not be discovered. If you are running unit tests for Windows Store apps and referencing custom WinMD type then please visit http://go.microsoft.com/fwlink/?LinkId=238340 for more info. Error details: System.IO.FileNotFoundException: Could not load file or assembly 'SpecResults, Version=0.1.0.7, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
9. 2015-08-03T21:26:29.7574029Z .
10. 2015-08-03T21:26:40.6922424Z Passed TheUserVisitsTheWebsite
11. 2015-08-03T21:26:41.3214684Z ##[error]Error: An exception occurred while invoking executor 'executor://mstestadapter/v1': Could not load file or assembly 'TechTalk.SpecFlow, Version=1.9.0.77, Culture=neutral, PublicKeyToken=0778194805d6db41' or one of its dependencies. The system cannot find the file specified.
12. 2015-08-03T21:26:41.3224680Z ##[error]
13. 2015-08-03T21:26:41.4936886Z Results File: C:\a\14076a40\TestResults\buildguest_TASKAGENT-0007 2015-08-03 21_26_40.trx
14. 2015-08-03T21:26:41.4956876Z Total tests: 1. Passed: 1. Failed: 0. Skipped: 0.
15. 2015-08-03T21:26:41.4966881Z ##[error]Test Run Failed.
16. 2015-08-03T21:26:41.4966881Z Test execution time: 11.8787 Seconds
17. 2015-08-03T21:26:41.7581094Z ##[error]VSTest Test Run failed with exit code: 1
18. 2015-08-03T21:26:41.7741099Z Publishing Test Results...
2015-08-03T21:26:43.0372165Z Test results remaining: 1
UPDATE: I disabled the SpecFlow test and added the simplest AboutController test possible (from file new project MVC in Visual Studio). I still get a 'could not load assembly problem. SpecByExample.Web is my MVC project in my solution.
2015-08-07T16:16:56.7251975Z ##[error]Error Message:
2015-08-07T16:16:56.7261978Z ##[error] Test method
SpecByExample.Web.Tests.Controllers.HomeControllerTests.AboutTest
threw exception: 2015-08-07T16:16:56.7261978Z
[error]System.IO.FileNotFoundException: Could not load file or assembly 'SpecByExample.Web, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null' or one of its dependencies. The system cannot
find the file specified.WRN: Assembly binding logging is turned OFF.
2015-08-07T16:16:56.7271982Z ##[error]To enable assembly bind failure
logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
2015-08-07T16:16:56.7271982Z ##[error]Note: There is some performance
penalty associated with assembly bind failure logging.
2015-08-07T16:16:56.7281979Z ##[error]To turn this feature off, remove
the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
2015-08-07T16:16:56.7281979Z ##[error] 2015-08-07T16:16:56.7291971Z
[error]Stack Trace: 2015-08-07T16:16:56.7291971Z ##[error] at SpecByExample.Web.Tests.Controllers.HomeControllerTests.AboutTest()
2015-08-07T16:16:56.7831986Z Results File:
C:\a\14076a40\TestResults\buildguest_TASKAGENT-0007 2015-08-07
16_16_56.trx 2015-08-07T16:16:56.7861977Z Attachments:
2015-08-07T16:16:56.7861977Z ##[error]Test Run Failed.
Here's a screenshot of my build definition:
In Run unit test step. click advance and give path to your packages folder. (if you are using nuget it will download all dependencies there) give it a try and let me know how it goes.

Build error in Windows Phone (Universal) app

I am trying to build a Windows Phone app. I am currently getting an error:
Processing Resources with error: Invalid qualifier value.
File: MakePri
and
Invalid qualifier: (null)
File: MakePRI
I was originally using the Multilingual App Toolkit, but I have since disabled it to no effect. When building with verbose output, I see (personal information redacted):
8>Using "GenerateProjectPriFile" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.Build.AppxPackage.dll".
8>Task "GenerateProjectPriFile"
8> C:\Program Files (x86)\Windows Kits\8.1\\bin\x86\MakePri.exe New -ProjectRoot [Redacted] -ConfigXml obj\Debug\priconfig.xml -OutputFile [Redacted] -ExtensionDll "C:\Program Files (x86)\Windows Phone Kits\8.1\bin\x86\MrmEnvironmentExtDl.dll" -IndexName 14de7fbe-f3e3-43a8-a9df-dddc72828f37 -Verbose -Overwrite
8> Option Verbose specified
8> Option Overwrite specified
8> Index Pass Completed: obj\Debug\layout.resfiles
8> Scale Qualifiers: 240
8>
8> Index Pass Completed: obj\Debug\resources.resfiles
8>
8>MakePri : error 0x80073b0a: Processing Resources with error: Invalid qualifier value.
8>
8>
8>MakePRI : error 0xdef00042: Invalid qualifier: (null)
8> The command exited with code -2147009782.
8>Done executing task "GenerateProjectPriFile" -- FAILED.
The output in Diagnostic mode does not give much more information.
Scaled images are only needed for the phone, so move them all to the "Assets" folder in the phone project, and single copies in the Windows "Assets" folder without qualifiers in their names. It was the only way I got the error messages to go away.
Solution
I had a portable class library that for some reason had the BCL Build Components installed to it when it didn't use them at all. I removed them from the PCL via Nuget and the problem went away.

Strange error while attempting to use Zip task from .net 4.0 version of MSBuild.ExtensionPack

We've been getting inconsistent results from the Zip task in Tigris MSBuild task library, so we're trying to use the Zip task in the MSBuild.ExtensionPack for .NET 4.0. But when we execute this new Zip task, we get the following error from the MSBuild executable:
C:\development\build\PrepareLastKnownGood.csproj(40,3): error : Typ
eInitializationException: The type initializer for 'java.lang.System' threw an
exception.\r
C:\development\build\PrepareLastKnownGood.csproj(40,3): error : Unsat
isfiedLinkError: Unable to load DLL 'vjsnativ': The specified module could not
be found. (Exception from HRESULT: 0x8007007E)\r
Has anyone else encountered this error in their use of the Zip task from MSBuild.ExtensionPack? If so, how did you resolve it?
Zip task from MSBuild.ExtensionPack.JSharp.dll is implemented in J#. And has dependency to the vjslib.dll.
You need to install Microsoft Visual J# Version 2.0 Redistributable Package.