Metadata file .dll cannot be found CSC error - visual-studio-2013

I am getting CSC errors when trying to build my project. I have reference numerous threads here including this one on metadata error dll not found.
I have checked build dependencies, unchecked and re-checked projects under Configuration Manager, checked environment variables for %VS120COMNTOOLS%, confirmed Path and C:\Windows\system32... I'm still getting a CSC error.
The error says that "Metadata file 'C:\Users\Username\Source\Workspaces\CompanyName\Main\CompanyDataModel\bin\Debug\CompanyDataModel.dll could not be found".
I've also looked and seen that I have a similar script as mentioned in this thread in my .bat files. For example, the VCVarsQueryRegistry file has for loops like this:
#for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1" /v "InstallationFolder"') DO (
#if "%%i"=="InstallationFolder" (
#SET "WindowsSdkDir=%%k"
)
)
Are these variables the problem? I tried to edit these for loops but right clicking and then Run as Administrator only brings up a blank command prompt and then it disappears. If I try to edit in Notepad, I get "Access denied" when I go to save the file.
What is causing these CSC errors?

As a last resort, I decided to download Visual Studio Ultimate 2013. (I was using Visual Studio Community 2013) After restarting Visual Studio Ultimate 2013, the metadata errors were still showing.
I then signed out of my Microsoft account and signed back in. I opened Visual Studio Ultimate 2013... and errors eliminated!

Related

Trying to Add a Reference to Visual Studio Project Suddenly Throws an Exception

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.

System.IO.IOException during the build process in VisualStudio 2017

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.

How to fix Setup project Prerequisites warning

When I go to the "Setup Property Pages" in a Visual Studio Setup project and view the Prerequisites, I see a warning:
Prerequisite could not be found for bootstrapping
I did the following things:
Added a new folder in: "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages" with my package
Restarted VS2010
(Even rebooted my pc)
Warning is still visible on that package.
Next I've added a .VSBootstrapperManifest file in the Packages directory ( C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages )
Restarted VS2010 again but that didn't help either, same with reboot.
Any suggestion what could be wrong?
This worked on my Win7 x64 machine, but this doesn't seem to work anymore on my Win8 Pro x64.
Thanks in advance.
update:
When I open the Product.xml file from my package I see these XML lines:
<InstallChecks>
<RegistryCheck Property="FoxProOleDbInstalled" Key="HKCR\CLSID\{...-..-..}\InprocServer32" />
</InstallChecks>
When I search that key {...-..-..} in my registry I cannot find it at the location HKCR\CLSID{...-..-..}
But I can find it at this location:
HKEY_CLASSES_ROOT\ Wow6432Node \CLSID\ {...-..-..}
Can I just add another line inside the InstallChecks-tag in the Product.xml ?
How will the RegistryCheck tags be checked in that file (AND? OR?)
(I think all InstallChecks need to be true but I'm not sure, the documentation is not so clear: http://msdn.microsoft.com/en-us/library/ms229432(v=vs.80).aspx )
If you are developing windows 8 store/metro apps in "windows 8 pro".
Use visual studio 2012 instead of vs2010.It will work.

Visual 2010 MFC new project doesn't build!

I just created a new project in Visual 2010. It is a multi-document MFC (static link) application with the HTML help option, Visual Studio 2008 style (with style changing option), that's about it.
Just after creation, I hit Build Solution and I get a lot build errors all in afxcomctl32.h. Errors like:
Error 1 error C2061: syntax error : identifier 'LPCWS' C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxcomctl32.h 426 1
On this line:
AFX_ISOLATIONAWARE_STATICLINK_FUNC(HWND ,CreateWindowExW,(DWORD dwExStyle,LPCWS TR lpClassName,LPCWSTR lpWindowName,DWORD dwStyle,int X,int Y,int nWidth,int nHeight,HWND hWndParent,HMENU hMenu,HINSTANCE hInstance,LPVOID lpParam),(dwExStyle,lpClassName,lpWindowName,dwStyle,X,Y,nWidth,nHeight,hWndParent,hMenu,hInstance,lpParam),NULL)
Same errors in Debug and Release.
My PC is Windows 7 Ultimate. What's the problem???
Best regards,
Downy
AFX_ISOLATIONAWARE_STATICLINK_FUNC(..., LPCWS TR lpClassName, ...)
That code got messed up, there is a space or tab inserted in LPCWSTR. Deleting it will fix the problem.
However, that changed the timestamp on the file as well, you may run into trouble when you install a future service pack. One thing to try is to rename the file, then run a Repair to get the original file back. Or copy it off another machine.

signtool error in visual studio 2008

After rebuilding my c++ project, I got this error message at my output box inside Visual Studio 2008.
1>SignTool Error: No certificates were found that met all the given criteria.
1>Project : error PRJ0019: A tool returned an error code from "Signing library..."
How to solve this?
update:
here is from my visual studio setting...
signtool sign /n "Against Intuition Oy" /t http://timestamp.verisign.com/scripts /timstamp.dll Release\WOT.dll
signtool cannot find a cerificate named "Against Intuition Oy" in your certificate store; do you have it?
Try running signtool from the command line, try some different options to see if it works out. Run 'signtool sign /?' to get information, or check msdn for additional info.
You can create certificates yourself:
makecert -r -pe -ss MyTempCert -n "CN=Against Intuition Oy" MyTempCert.cer
sign:
signtool sign /a /s MyTempCert /n "Against Intuition Oy" Release/WOT.dll
If you do not need signing, disable or delete the postbuild event in the project's setting (in release mode, your debug mode doesn't have it) and obviously you will not get errors anymore.
In my case, I had the same error only because my user account had no password.
Setting a password for the user account fixed the issue.

Resources