I am trying merging DLL files using the ILMerge tool.
The command line I used is
C:\Program Files (x86)\Microsoft\ILMerge>ilmerge /t:dll /out:NewFile.dll D:\victor\Excelimport.dll D:\victor\BOL3.dll**
But I got the following error. Can anyone tell me why I got this error: Unresolved assembly reference not allowed
An exception occurred during merging:
Unresolved assembly reference not allowed: Microsoft.Dexterity.Shell.
at System.Compiler.Ir2md.GetAssemblyRefIndex(AssemblyNode assembly)
at System.Compiler.Ir2md.GetTypeRefIndex(TypeNode type)
at System.Compiler.Ir2md.VisitReferencedType(TypeNode type)
at System.Compiler.Ir2md.VisitClass(Class Class)
at System.Compiler.Ir2md.VisitModule(Module module)
at System.Compiler.Ir2md.SetupMetadataWriter(String debugSymbolsLocation)
at System.Compiler.Ir2md.WritePE(Module module, String debugSymbolsLocation, BinaryWriter writer)
at System.Compiler.Writer.WritePE(String location, Boolean writeDebugSymbols, Module module, Boolean delaySign, String keyFileName, String keyName)
at System.Compiler.Writer.WritePE(CompilerParameters compilerParameters, Module module)
at ILMerging.ILMerge.Merge()
at ILMerging.ILMerge.Main(String[] args)
Related
I have a T4 Template file in my project and I use it everyday but after upgrade into 16.4.5 version I'm getting this error when I Run Custom Code:
Severity Code Description Project File Line Suppression State
Error Running transformation:
System.Runtime.InteropServices.COMException (0x80004005): Error
HRESULT E_FAIL has been returned from a call to a COM component. at
System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32
errorCode, IntPtr errorInfo) at
Microsoft.VisualStudio.LanguageServices.Implementation.Utilities.Exceptions.ThrowEFail()
at
Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.FileCodeModel.GetDocument()
at
Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.FileCodeModel.GetSyntaxTree()
at
Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.FileCodeModel..ctor(CodeModelState
state, Object parent, DocumentId documentId, ITextManagerAdapter
textManagerAdapter) at
Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.CodeModelProjectCache.GetOrCreateFileCodeModel(String
filePath, Object parent) at
Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.ProjectCodeModel.Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.IProjectCodeModel.GetOrCreateFileCodeModel(String
filePath, Object parent) at
Microsoft.VisualStudio.LanguageServices.CSharp.ProjectSystemShim.CSharpProjectShim.CreateFileCodeModel(String
fileName, Object parent, FileCodeModel& ppFileCodeModel) at
EnvDTE.ProjectItem.get_FileCodeModel() at
Microsoft.VisualStudio.TextTemplatingA79231EE6EFCFD9A9F7580CC47D516BF0E336BDEE9E25B0EE85E3BDE9AA5F22021A94E93566B81968DF5D01D105C4011D1E60A396DC22B9D70AA7669950944CC.GeneratedTextTransformation.d__7.MoveNext()
in XXX\SecurityKeys.tt:line 134 at
Microsoft.VisualStudio.TextTemplatingA79231EE6EFCFD9A9F7580CC47D516BF0E336BDEE9E25B0EE85E3BDE9AA5F22021A94E93566B81968DF5D01D105C4011D1E60A396DC22B9D70AA7669950944CC.GeneratedTextTransformation.d__6.MoveNext()
in XXX\SecurityKeys.tt:line 127 at
Microsoft.VisualStudio.TextTemplatingA79231EE6EFCFD9A9F7580CC47D516BF0E336BDEE9E25B0EE85E3BDE9AA5F22021A94E93566B81968DF5D01D105C4011D1E60A396DC22B9D70AA7669950944CC.GeneratedTextTransformation.TransformText()
in XXX\SecurityKeys.tt:line 48 MYPROJECT XXX\SecurityKeys.tt 134
I tested the same file in my colleague's workstation with previous version of VS and it worked.
just exclude all project files and folders then include them again! it works
On Visual Studio for Mac 7.1, I am trying to build a project that builds fine on Visual Studio 20176 Update 3.
The first error on a project file is:
Target ResolveKeySource:
/Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(3103,5): error MSB3322: Unable to get MD5 checksum for the key file "../xxx.pfx". Could not find file "/Users/PATH/xxx.pfx".
Done building target "ResolveKeySource" in project "yyy" -- FAILED.
The pfx actually exists and is readable.
With more logging enabled, it reads:
error MSB4018: The "ResolveKeySource" task failed unexpectedly.
error MSB4018: System.NotSupportedException: Specified method is not supported.
error MSB4018: at System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeInterfaceAsObject (System.Guid clsid, System.Guid riid) [0x00006] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/interopservices/runtimeenvironment.cs:204
error MSB4018: at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
error MSB4018: at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
I've been playing around with changing the file format for signing, but would like to have one solution that builds easily on Windows and Mac.
Is there a solution with one file format for signing the assemblies?
I just recompiled some old signing-based Xamarin.Android apps w/ the latest Xamarin versions using msbuild/csc and .pfx just do not work (unless there is some magic I am missing).
But converting the .pfx to a .snk to extract the public key worked fine, use the mono version of "StrongName utility for signing assemblies" (sn) on macOS:
sn -p certificate.pfx certificate.snk
It will prompt you for the password, use the resulting .snk file instead. The .snk file will work fine on Windows also.
I was working on a project and got the following errors
Error (active) the default constructor of "Input" cannot be referenced -- it is a deleted function EquationSolver c:\Users\Kim\Documents\Visual Studio 2015\Projects\EquationSolver\EquationSolver\main.cpp 10
Error C2280 'Input::Input(void)': attempting to reference a deleted function EquationSolver <project_dir>\main.cpp 10
Since it is almost impossible to find the cause of the error from this, I tried compiling with gcc with -Wall and got following output
main.cpp: In function 'int main()':
main.cpp:10:9: error: use of deleted function 'Input::Input()'
Input input;
^~~~~
In file included from main.cpp:2:0:
Input.hpp:16:7: note: 'Input::Input()' is implicitly deleted because the default definition would be ill-formed:
class Input
^~~~~
Input.hpp:16:7: error: use of deleted function 'Expressions::Expressions()'
In file included from Input.hpp:11:0,
from main.cpp:2:
Expressions.hpp:8:7: note: 'Expressions::Expressions()' is implicitly deleted because the default definition would be ill-formed:
class Expressions
^~~~~~~~~~~
Expressions.hpp:8:7: error: uninitialized reference member in 'class Expressions'
Expressions.hpp:17:8: note: 'Expressions::Vec& Expressions::left' should be initialized
Vec& left;
^~~~
Expressions.hpp:8:7: error: uninitialized reference member in 'class Expressions'
class Expressions
^~~~~~~~~~~
Expressions.hpp:18:8: note: 'Expressions::Vec& Expressions::right' should be initialized
Vec& right;
^~~~~
This output is much more verbose and quickly helped me find the origin, which was a misplaced & (class member should be Vec left, was Vec& left).
Is it possible to make Visual Studio as verbose?
When putting Visual Studio to /Wall, I get >1800 warnings, most completely unrelated to my project, but I still only get those two errors.
I am using below snippet in my code.
//from Vista WinNT.h
//
typedef struct _TOKEN_MANDATORY_LABEL {
SID_AND_ATTRIBUTES Label;
} TOKEN_MANDATORY_LABEL, *PTOKEN_MANDATORY_LABEL;
When I build this through VS2005 it give no error. But when I am building using make file i am getting below error in cmd:
Test.cpp(337) : error C2011: '_TOKEN_MANDATORY_LABEL' : 'struct' type redefinition
C:\Program Files\Microsoft SDKs\Windows\v6.1\include\winnt.h(7351) : see declaration of '_TOKEN_MANDATORY_LABEL'
I am using Opus software to use make file. Please let me know if I am missing something or needs to add some libs to overcome this error.
Anyone have any insight as to what this error is, and how to fix/avoid it?
Warning 1 An internal error occurred in PlatformVerificationTask. System.IO.IOException: The file exists.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.__Error.WinIOError()
at System.IO.Path.GetTempFileName()
at Microsoft.CompactFramework.Build.DeviceTypeResolver.CreateDynamicAssembly(String fileName)
at Microsoft.CompactFramework.Build.DeviceTypeResolver.LoadAssembly(String codebase, Boolean canlock)
at Microsoft.CompactFramework.Build.DeviceTypeResolver..ctor(ICollection references)
at Microsoft.CompactFramework.Build.AsmmetaContext..ctor(String ndpversion, String platformFamily, String platformID, ICollection references)
at Microsoft.CompactFramework.Build.Tasks.PlatformVerificationTask.Execute()
I have doctored up a project to run the compiler to build .NET CF dlls from within VS2010, according to this SO question ( Building Compact Framework applications with VS2010 (without VS2005) ) . The build was working but now it stopped with this odd error.
I figured it out. By... uh.... Reading the documentation.
The doc page for System.IO.Path.GetTempPathName says
The GetTempFileName method will raise an IOException if it is used to create more than 65535 files without deleting previous temporary files.
The GetTempFileName method will raise an IOException if no unique temporary file name is available. To resolve this error, delete all unneeded temporary files.
So... I deleted the tmp????.tmp files from C:\Users\USERNAME\AppData\Local\Temp, and everything worked again.