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
Related
I have followed the instructions at https://www.preemptive.com/dotfuscator/ce/docs/help/getting_started_xamarin.html#setup-targets and verified the accuracy multiple times. It says the first build will create DotfuscatorConfig.xml but it fails with Error 1. Then it says to set verbosity to Normal, so I did, but still no revelation why it won't create the file. I can change the build back to Debug and it builds fine, but changing back to release produces the same two errors. Has anyone experienced this and solved it?
Severity Code Description Project File Line Suppression State
Error The command ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\PreEmptiveSolutions\DotfuscatorCE\dotfuscator.exe" /p:InDir="obj\Release\100\DotfuscatorXamarin\dfin",OutDir="obj\Release\100\DotfuscatorXamarin\dfout",ReportDir="DotfuscatorReports\Release" "obj\Release\100\DotfuscatorXamarin\Template.dfconfig" /in:+"${configdir}${InDir}\WetYourWhistle.Android.dll",+"${configdir}${InDir}\WetYourWhistle.dll" /makeconfig:"DotfuscatorConfig.xml"" exited with code 1. WetYourWhistle.Android C:\Users\leuol\source\repos\WetYourWhistle\PreEmptive.Dotfuscator.Xamarin\PreEmptive.Dotfuscator.Xamarin.targets 508
Severity Code Description Project File Line Suppression State
Error The "_DotfuscatorXamarin_SetProjectPropsTask" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file 'C:\Users\leuol\source\repos\WetYourWhistle\WetYourWhistle\WetYourWhistle.Android\DotfuscatorConfig.xml'.
File name: 'C:\Users\leuol\source\repos\WetYourWhistle\WetYourWhistle\WetYourWhistle.Android\DotfuscatorConfig.xml'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.FinishInitUriString()
at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver)
at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
at System.Xml.Linq.XDocument.Load(String uri)
at InlineCode._DotfuscatorXamarin_SetProjectPropsTask.Execute() in c:\Users\leuol\AppData\Local\Temp\r0wqtkdr\r0wqtkdr.0.cs:line 93
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() WetYourWhistle.Android C:\Users\leuol\source\repos\WetYourWhistle\PreEmptive.Dotfuscator.Xamarin\PreEmptive.Dotfuscator.Xamarin.targets 520
Error The command ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\PreEmptiveSolutions\DotfuscatorCE\dotfuscator.exe" /p:InDir="obj\Release\100\DotfuscatorXamarin\dfin",OutDir="obj\Release\100\DotfuscatorXamarin\dfout",ReportDir="DotfuscatorReports\Release" "obj\Release\100\DotfuscatorXamarin\Template.dfconfig" /in:+"${configdir}${InDir}\WetYourWhistle.Android.dll",+"${configdir}${InDir}\WetYourWhistle.dll" /makeconfig:"DotfuscatorConfig.xml"" exited with code 1. WetYourWhistle.Android C:\Users\leuol\source\repos\WetYourWhistle\PreEmptive.Dotfuscator.Xamarin\PreEmptive.Dotfuscator.Xamarin.targets 508
UPDATE - Now the code is compiling without error but still will not produce the DotfuscatorConfig.xml file. Not sure what else to try and it appears that nobody else knows either.
The solution is to temporary change the command dotfuscator.exe to dotfuscatorUI.exe :
<PropertyGroup>
<DotfuscatorXamarinConfigFileName>DotfuscatorConfig.xml</DotfuscatorXamarinConfigFileNam
<DotfuscatorXamarinCliPath>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\PreEmptiveSolutions\DotfuscatorCE\dotfuscatorUI.exe</DotfuscatorXamarinCliPath>
<DotfuscatorGenerateConfigFileIfMissing>true</DotfuscatorGenerateConfigFileIfMissing>
<DotfuscatorEnabled>true</DotfuscatorEnabled>
<DotfuscatorXamarinEnabled Condition="'$(Configuration)' == 'Release'">true</DotfuscatorXamarinEnabled>
</PropertyGroup>
<Import Project="../../PreEmptive.Dotfuscator.Xamarin/PreEmptive.Dotfuscator.Xamarin.targets" />
Then start build. The dotfuscator UI starts with a window:
Show Image
Then press "Build". After it finishes, close then window by clicking "x" on top right. Then the output on Visual Studio shows a successful result:
Build started: Project: [AppName].Android, Configuration: Release Any CPU ------
[AppName].Android -> D:\Users\[UserName]\source\repos\[FolderName]\[AppName]\[AppName].Android\bin\Release\[AppName].Android.dll
Running Dotfuscator with a new config file based on project references...
Finished running Dotfuscator with a new config file.
D:\Users\[UserName]\source\repos\[FolderName]\[AppName]\[AppName].Android\[AppName].Android.csproj : warning : A new Dotfuscator config file was generated because it did not exist: 'DotfuscatorConfig.xml'.
You can see dotfuscatorconfig.xml is created at a folder [AppName].Android.
Then revert back from dotfuscatorUI.exe to dotfuscator.exe .
<PropertyGroup>
<DotfuscatorXamarinConfigFileName>DotfuscatorConfig.xml</DotfuscatorXamarinConfigFileNam
<DotfuscatorXamarinCliPath>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\PreEmptiveSolutions\DotfuscatorCE\dotfuscator.exe</DotfuscatorXamarinCliPath>
<DotfuscatorGenerateConfigFileIfMissing>true</DotfuscatorGenerateConfigFileIfMissing>
<DotfuscatorEnabled>true</DotfuscatorEnabled>
<DotfuscatorXamarinEnabled Condition="'$(Configuration)' == 'Release'">true</DotfuscatorXamarinEnabled>
</PropertyGroup>
<Import Project="../../PreEmptive.Dotfuscator.Xamarin/PreEmptive.Dotfuscator.Xamarin.targets" />
Then the build should work without a UI popup.
When I try to ADD a REFERENCE to any Visual Studio project...I am suddenly getting the following exception:
Error HRESULT E_FAIL has been returned from a call to a COM component
This happens across ALL projects regardless of whether they are source-controlled (or not)
SIDE NOTE:
I did recently install Xamarin on a SEPARATE PROJECT in another TFS SOLUTION
WHAT I'VE DONE SO FAR:
Delete all *.suo files
Delete all *.user files
Wiped the TFS Workspace & done a FORCE GET
Nothing has worked
The FIRST TIME you get this error message you'll get a window with a reference to the following file:
ActivityLog.xml: This file contains information about the underlying error.
If you ignore the message & click away from the initial dialog, THE ERROR GETS SUPPRESSED and is replaced with:
Error HRESULT E_FAIL has been returned from a call to a COM component.
If you look in this file you will see the error. This particular exception was was caused by:
Microsoft.visualstudio.shell.interop.IVsReferenceManager2
Within the Microsoft.VisualStudio.Shell.Interop.11.0.dll library.
This post helped me solve the issue!
THE FIX IS:
Open "Developer Command Prompt for VS 2017" as an Administraor
CD into "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PublicAssemblies"
Run "gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll"
After a restart, it all worked well.
I'm working on a Hololens application using Unity 2018.2.20f1. I'm building the application for UWP from Unity without a problem. However, after opening up the generated solution in the VisualStudio 2017 (Community Edition) and trying to build it, the build process fails with the following errors:
Severity Code Description Project File Line Suppression State
Error MSB3073 The command ""D:\Projects\VSProjects\VirtualPrague\Il2CppOutputProject\\IL2CPP\build\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=x86 -configuration=Release -platform=winrt -outputpath="D:\Projects\VSProjects\VirtualPrague\\build\bin\Win32\Release\GameAssembly.dll" --data-folder="D:\Projects\VSProjects\VirtualPrague\\build\bin\Win32\Release\\" -cachedirectory="D:\Projects\VSProjects\VirtualPrague\\build\obj\il2cppOutputProject\Win32\Release\\" -generatedcppdir="D:\Projects\VSProjects\VirtualPrague\Il2CppOutputProject\\Source" --additional-defines=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT --additional-defines=PLATFORM_WINRT -dotnetprofile=unityjit -verbose --map-file-parser="D:\Projects\VSProjects\VirtualPrague\Il2CppOutputProject\\IL2CPP\MapFileParser\MapFileParser.exe"" exited with code -532462766. Il2CppOutputProject C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets 44
and
Severity Code Description Project File Line Suppression State
Error LNK1181 cannot open input file 'D:\Projects\VSProjects\VirtualPrague\build\bin\Win32\Release\GameAssembly.lib' VirtualPrague D:\Projects\VSProjects\VirtualPrague\VirtualPrague\LINK 1
In the output there are multiple exceptions, similar to this one:
1>il2cpp.exe didn't catch exception: System.IO.IOException: The process cannot access the file 'C:\Users\dev\AppData\Local\Temp\tmpDE97.tmp' because it is being used by another process.
1> at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
1> at System.IO.File.InternalDelete(String path, Boolean checkHost)
1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
1> at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
1> at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
1> at il2cpp.Program.DoRun(String[] args)
1> at il2cpp.Program.Run(String[] args)
1> at il2cpp.Program.Main(String[] args)
The exceptions are the same but were thrown for different files. I tried to reinstall the Visual Studio and managed to get a build. The next day I turned on the PC and this error was back. I stopped all of the VS instances and processed from the task manager, deleted all of the files from the Temp folder and managed to get a build a couple more times. Then this error came back.
From what I can tell, during the build process, Visual Studio creates some *.tmp files and for some reason thinks that another process is using it.
Any idea why this is happening and how can it be solved?
Thanks a lot!
Edit: So here is what I did so far (this is more of a work around rather then a solution)
Uninstall vs and unity
Clear the registry with ccleaner and Advanced Uninstaller Pro
Install vs and Unity
Every time I want to get a build I,
Close all of vs instances
Clear Temp folder (C:\Users\dev\AppData\Local\Temp)
Delete previous vs solution
Build from Unity
Run vs as Administrator
Build and deploy the solution from vs
And it works for the most the time. Also, changing the solution configuration (from debug to release and vice versa) helps sometimes.
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)
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.