Trying to debug custom FxCop rule fails because FxCopCmd can't load the assembly (CA0055) - fxcop

I'm trying to debug a custom FxCop rule I wrote by following this FAQ: http://blogs.msdn.com/b/codeanalysis/archive/2007/05/16/faq-how-do-i-debug-a-custom-rule.aspx ("Debugging within Visual Studio or via command-line" section)
Initially I got some errors about missing references, but I managed to fix those by using the following command line:
FxCopCmd.exe /searchgac /d:"SomeDir" /file:"MyAssembly.dll" /rule:"MyCustomRules.dll" /console
Now, I'm getting the following error:
Project : error : CA0055 : Could not load MyAssembly.dll. Signature is not valid.
Project : error : CA0052 : No targets were selected.
I made sure that MyAssembly.dll is signed with my test signing certificate, and that all of the certificates in the certification path are in the "Trusted Root Certification Authorities" (of the current user) but it doesn't help.
Does anyone know what this error means?
Thanks!

Related

SignTool Error: Invalid option: /fd

I publish my exe and activate auto updates.
But when I compile the exe, there is an error:
Severity Code Description Project File Line Suppression State Error An
error occurred while signing: Failed to sign
bin\Debug\app.publish\myapp.exe. SignTool Error: Invalid option: /fd
So I couldn't publish.
When I try to uncheck "Sign the ClickOnce manifest" the error is gone
but I couldn't install the package because Windows doesn't allow and the Windows Defender SmartScreen blocks my app because there's no certificate.
I have to add a certificate from "Sign the ClickOnce manifest" but now it gives the "SignTool Error: Invalid option: /fd" error.
How can I solve this problem?
I had to change the Signature Algorithm to sha1RSA from sha256RSA
I did just the opposite as Stefano - changed it from sha256RSA to sha1RSA - and then it allowed me to publish without the error.
Just changing the signature algorithm may do the trick.
I encountered the same error message when migrating an old ClickOnce project from VS2018 to VS2017. It seems my VS2018 was using an old version of SignTool.
I found (and succeeded with) a tip to change registry key HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows to make Windows to use newer SDK (in my situation SDK v8.1A was the most recent).
The original tip can be found here: https://social.msdn.microsoft.com/Forums/en-US/a39b9f82-aaec-4bbd-8cb2-3cade50796ba/an-error-occurred-while-signing-failed-to-sign-bindebugapppublishprogramexe-signtool-error (scroll down to answer by nikidimi)
Go to the myapp.csproj file, which is the project file, and search for 'SignManifests' PropertyGroup, change the value to false, and the error disappears. This worked for me.

I was trying to create a new Liferay Plugin Project and it showed the following error

I changed the ivy.jar.url to the above mentioned url and now it came up with a new error as follows:
[Console output redirected to
file:C:\Rahul13615\liferay.metadata.plugins\com.liferay.ide.sdk.core\sdk.log]
Buildfile: C:\Rahul13615\liferay\plugins\portlets\build.xml
[get] Getting: https://repository.liferay.com/nexus/content/repositories/liferay-public-snapshots/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
[get] To: C:\Rahul13615\liferay\plugins.ivy\org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
[taskdef] Could not load definitions from resource org/apache/ivy/ant/antlib.xml. It could not be found.
BUILD FAILED
C:\Rahul13615\liferay\plugins\portlets\build.xml:5: The following error occurred while executing this line:
C:\Rahul13615\liferay\plugins\build-common-plugins.xml:5: The following error occurred while executing this line:
C:\Rahul13615\liferay\plugins\build-common.xml:47: The following error occurred while executing this line:
C:\Rahul13615\liferay\plugins\build-common-ivy.xml:102: The following error occurred while executing this line:
C:\Rahul13615\liferay\plugins\build-common-ivy.xml:38: The following error occurred while executing this line:
C:\Rahul13615\liferay\plugins\build-common-ivy.xml:48: Problem: failed to create task or type antlib:org.apache.ivy.ant:settings
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any / declarations have taken place.
No types or tasks have been defined in this namespace yet
This appears to be an antlib declaration.
Action: Check that the implementing library exists in one of:
-ANT_HOME\lib
-the IDE Ant configuration dialogs
Total time: 11 seconds
Below please find my steps how I created a new Liferay Plugin Project.
I hope this will be useful to you:
I have downloaded Liferay Developer Studio 3.0.1. GA2 from:
htt ps://web.liferay.com/downloads/liferay-projects/liferay-ide or
ht tps://sourceforge.net/projects/lportal/files/Liferay%20IDE/
Note: there are some known issue with the 3.0.0 version
I extracted the IDE to C:\dstudio3 on my computer
I downloaded the Liferay SDK from:
http s://www.liferay.com/downloads?559250categoryIds=559255
(bottom of the page, additional files section)
I copied the SDK to the IDE's folder and created a personalized build.peter.properties file, based on:
htt ps://web.liferay.com/community/forums/-/message_boards/message/76813485
I started Eclipse and set up a new Liferay Server environment
In Eclipse, I created a new "Liferay Plugin Project", and in the wizard, I defined the location of the Plugins SDK.
I created a new Liferay Portlet project inside the Plugin project.
Best Regards,
Peter

Out of process server in VOIP

I found voip example on github for UWP. Now I'm trying to create my voip app, and I want to use VoipHost project in my app. I added existing project, edited package manifest file. When I want to deploy the app to the device I get error:
Severity Code
Description Project
File Line
Suppression State Error
DEP6701 : Bootstrapping failed with unexpected error: 'The ID value is not specified. Parameter name: id'.
VoipHost
And one warning:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets(1930,5): warning APPX1708: The executable 'VoipHost.exe' is specified as the implementation for the .winmd file. Only in-process servers are supported for generating registration information in the app manifest. You must specify the out-of-process server registration information in the app manifest.
Any advices?
Many thanks.
I had a similar issue deploying a headless application with Windows IoT running in a Raspberry pi 3. I solved the problem giving an "Assembly Identity" in the project properties.
You can do that following the next steps: Rigth Click to project --> Properties --> Manifest Tool --> General.
Fill the field "Assembly Identity" with any number. After that compiles, run and works like a charm.

ClickOnce running an error when publishing Application

whenever I try to publish my application and it gives me this error:
Failed to connect to '\localhost\users\Dylan Garcia\Desktop\8.2.1_File\' with the following error: unable to create the Web site '\localhost\users\Dylan Garcia\Desktop\8.2.1_File\'. The path '\localhost\users\Dylan Garcia\Desktop\8.2.1_File\' does not exist or you do not have access. The specified path is invalid.
how could i resolve this issue?
Hope you have already fixed this error.
First make sure that you have created the folder 8.2.1_File on your desktop, then try either one of the following
\\\localhost\users\Dylan Garcia\Desktop\8.2.1_File\
or
C:\users\Dylan Garcia\Desktop\8.2.1_File\

KNIME node extension fails to execute: "Support code location could not be determined"

I'm creating a node extension for KNIME with the KNIME SDK (which is just an adapted Eclipse). I'm done with my code, I tested it in Eclipse, it worked perfectly. So I exported it, copied the .jar to the subfolder dropins in my KNIME installation, and started KNIME. Made a new workflow, added my node, tried to execute it and then the following error appeared:
Execute failed: Support code location could not be determined. Could not convert from URL to URI location.
URL Location: file:/C:/Program Files/KNIME_2.11.2/configuration/org.eclipse.osgi/bundles/528/1/.cp/matlabcontrol-4.1.0.jar
Code Source: (file:/C:/Program Files/KNIME_2.11.2/configuration/org.eclipse.osgi/bundles/528/1/.cp/matlabcontrol-4.1.0.jar <no signer certificates>)
Protection Domain: ProtectionDomain (file:/C:/Program Files/KNIME_2.11.2/configuration/org.eclipse.osgi/bundles/528/1/.cp/matlabcontrol-4.1.0.jar <no signer certificates>)
null
<no principals>
java.security.AllPermissionCollection#6ac1c077 (
("java.security.AllPermission" "<all permissions>" "<all actions>")
)
Class Loader: org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader#b836456
Class Loader Class: class org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader
According to a thread on the KNIME forums, a similar problem also occurs with the community extension "Matlab Snippet", which builds on the same matlabcontrol framework I use (which is also the one mentioned in the error).
I tried evading the problem by including the matlabcontrol as a package in my project (it's open source, so I could just import the sources), then the same error appeared and mentioned the package .jar created by the OSGI system (in my case, matlab.jar, which is the name I chose in my build.properties), so I assume it was just the first one alphabetically and all of the files in the OSGI bundle folder are affected by this problem.
What confuses me is that the problem only occurs once I try to execute the node and connect to MATLAB. Unfortunately, the problem doesn't seem to have been resolved in the KNIME forum thread linked above, apparently an older version of that extension didn't have the issue and users just installed the old version.
So, can I somehow make the URL correctly convert to URI? Is the Protection Domain the cause and can I change it? Does it have anything to do with the default Class Loader?
I have now installed the plugin via a feature in a folder (see comments). The error persists, but the path changed:
Execute failed: Support code location could not be determined. Could not convert from URL to URI location.
URL Location: file:/C:/Program Files/KNIME_2.11.2/plugins/org.knime.ext.matlab_1.0.0/matlab.jar
Code Source: (file:/C:/Program Files/KNIME_2.11.2/plugins/org.knime.ext.matlab_1.0.0/matlab.jar <no signer certificates>)
Protection Domain: ProtectionDomain (file:/C:/Program Files/KNIME_2.11.2/plugins/org.knime.ext.matlab_1.0.0/matlab.jar <no signer certificates>)
null
<no principals>
java.security.AllPermissionCollection#2da869b5 (
("java.security.AllPermission" "<all permissions>" "<all actions>")
)
Class Loader: org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader#372bf03c
Class Loader Class: class org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader