Cannot compile .NET CF project containing Design time attributes without Visual Studio? - visual-studio

I'm working on a .NET Compact Framework 3.5 app. I have an automated build machine that does not have Visual Studio installed, and all has been fine.
I'm trying to a a new solution containing control projects that have DesignTimeAttributes.xmta files. MsBuild on the build machine is failing with cannot find file, C:\Program Files\Microsoft Visual Studio 9.0\SDK\v3.5\Bin\genasm.exe.
I've tried manually adding this directory and it's contents from my dev box to the build machine, but now I'm getting
c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.CompactFramework.Common.targets(67,9): error : genasm.exe(1) : error There was an error reading arguments. Could not load file or assembly 'Microsoft.CompactFramework.Build.Tasks, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Done executing task "BuildAsmmeta" -- FAILED.
Before I struggle further with this, I thought I'd ask if anyone else out there has gotten a CompactFramework project with design time attributes building on a machine without Visual Studio?

Filburt: I've already installed the Windows SDK, the .NET SDK, and the CF SDK. I realize now that "all has been fine" in the original question doesn't make that clear.
None of the SDK's installed anything into the Microsoft Visual Studio 9.0 directory.
I've given up and installed VS at this point, but thanks for the answer.

You think need to install the Windows .NET Framework SDK on your build machine to obtain the tools that come with Visual Studio.
update
Since you stated you installed all SDKs you could check %ProgramFiles%\Microsoft SDKs\Windows\v6.1\Bin\SetEnv.cmd for any quirks in the PATH settings. I discovered some inconsistencies there for an x64 environment.

Related

missing dll errors after creating installer for my project in Visual Studio 2010

I have a fairly large project in Visual Studio 2010
I can build the project in both Debug and Release mode, copy the generated exe file along with a custom dll I need for a function in the program to another computer, and the exe file works without any problems
I am trying to make an installer for this project in Visual Studio 2010, following the instructions here: https://www.technical-recipes.com/2011/how-to-create-an-installer-in-microsoft-visual-studio/
I do not get any errors while building the installer, and I get a setup.exe and an msi file as a result, but if I install my program in another computer (not by development machine), when I try to run my program after installation I get a missing api-ms-win-crt-runtime-l1-1-0.dll error
How do I debug this problem? Since I can simply copy my Release or Debug build to the computer and make it work, doesn't it mean all the dll files my program is dependent on already exists in the other computer? And if this already works, why isn't the installer version working? How do I make sure that everything I need for this program is included in the installer?
My project in MFC dialog based and uses one third party library, for which I have both .lib and .dll file available. I need to do this in Visual Studio 2010. My development machine is Windows 10 64 bit Home edition version 1909. The installer I currently create installs my program in Program Files (x86) folder.
Static Linking MFC: It appears this issue was solved by making sure to statically link to MFC libraries. In the VC++ project: enable the setting: "include MFC in a static library". This enables static linking of MFC components, eliminating the dependency on shared dlls.
This is a common "missing runtime error" - there are generic check lists below which include this as one source for application launch problems.
Warning: Generally static linking should be avoided in order to benefit from security updates to shared dll files via other update mechanisms.
Short Version: In Visual Studio Installer Projects, check if the Visual C++ Runtime is available in the Prerequisites list.
See this answer, here is a quick screen shot:
Tools: If your project is large you might want to consider another MSI tool. There are many limitations with Visual Studio Installer Projects.
Merge Modules: There are merge modules to install the Visual Studio C++ Runtime, but it is recommended to use the setup.exe for these reasons.
Visual C/C++ Runtime: You are probably just missing the Visual Studio C/C++ Runtime. It needs to be deployed with your application, it is not on there by default (unless you link statically, in which case it should not be needed). Skim this list quickly for other ideas.
You can download the VC++ redistributables at ("The latest supported Visual C++ downloads"):
https://support.microsoft.com/en-us/kb/2977003
More Information:
More on the Visual C/C++ Runtime
Secondary Links:
Detecting presence of Visual C/C++ runtime on box
Missing Dependencies and check lists
Scan for application dependencies
Installing VC++ Runtime with merge modules

ionic2 with visual studio MSB3644 error when starting new project

Am using visual studio 2015 but whenever i begin a new ion ionic2 project an error
MSB3644 The reference assemblies for framework ".NETFramework,Version=v4.0" were not found.
To resolve this, install the SDK or Targeting Pack for
this framework version or retarget your application to a version of the framework for
which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved
from the Global Assembly Cache (GAC) and will be used in place of reference assemblies.
Therefore your assembly may not be correctly targeted for the framework you intend.
After a research on the error i found out This link and This link but am using windows 10 on a 32 bit computer with program files folder and without the program filesx86 folder
Am not using any server and also a newbie to visual studio
I have also checked and
C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0. is there
I also found out you need to add
msbuild -p:FrameworkPathOverride="C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.
But am not sure where am supposed to add it
Can someone help me on this issue
But am not sure where am supposed to add it
Please run "Msbuild Command Prompt for VS2015"
Go to the folder of project
run the msbuild command
msbuild -p:FrameworkPathOverride="C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0"

Fixing the "MSVCP110D.dll is missing from your computer" issue

I am facing the following (fairly common) problem: I am running my program in Debug mode in VS2010 and/or VS2012, but at startup it crashes, saying:
The programme can't start because MSVCP100D.dll is missing from your
computer. Try reinstalling the program to fix this problem.
Now I found a number of possible solutions, but none of them work for me:
Compile with /MTd instead of /MDd: actually this does solve the problem, but I am not allowed to: my program is part of a bigger program, and /MD[d] is mandatory.
Install the VS 2010 Redistributable package: This doesn't work because I have VS 2012 installed, so this installer tells me: "A newer version of Microsoft Visual C++ 2010 Redistributable has been detected on the machine."
Finding, dragging and dropping a version of MSVCP100D.dll into the correct directory: I am not dropping unknown DLLs into places where they might interfere with other things.
Last resort: reinstalling VS2010/VS2012: possible, but as it would also mean reinstalling lots of other packages and plugins I need, I'd like to avoid this if it's not absolutely necessary.
Are there any other options left?
The Visual Studio REDIST packages never deploy the DEBUG versions of the CRT files. This is by design.
With VS 2012 or later, the easiest way to deploy the DEUBG versions of the CRT is to install the "Remote Debugging Tools" package on your test machines.
For VS 2012, the latest Remote Debugging Tools package is here
For VS 2013, the latest Remote Debugging Tools package is here.
Another option is to just use application local deployment of the DLL (i.e. copy it into your app directory). Again this is only for testing purposes. For actual deployment of your application, you are required to use the non-debug versions of the CRT.
If this error is happening on your development machine, however, then you have other problems because with VS 2012 installed, you should have the VS 2012 DEBUG CRT on that machine.
UPDATE:: Sorry, I would have expected the debug CRT DLLs to be included in the remote debugging tools package along with the remote debugger bits and the Direct3D 11 Debug Device. Alas, it's not. See Preparing a Test Machine To Run a Debug Executable. You have to either use the MSMs in Program Files (x86) directory in \Common Files\Merge Modules or copy the DLL-side-by-side from Program Files (x86) directory in \Microsoft Visual Studio <version>\VC\redist\Debug_NonRedist\. The VS Team probably assumed you would have already been doing that, but I'll suggest to them to roll it into the remote tools package.
I had a similar issue (the project made in VS 2012 but I was running VS2013) and resolved it by:
Open the project (or the solution ) in VS2013(or the newer one)
Open Project menu and select "Retarget the project" option (it was the first option but after applying it, this option vanished).
Rebuild your solution.
I am new to openCV and C++ and had the same problem using openCV 2.4.10 with Visual Studio Express 2013 on a Windows 7, 32-bit platform. If I made a simple program without using OpenCV, the program ran but when I used OpenCV I got the missing DLL error.
This post made things clear:
I guess the problem I had was not with my Visual Studio but my OpenCV. The OpenCV was compiled on a version of visual studio which required MSVCP110.dll. I could have tried another version of OpenCV or compiled OpenCV again using VS2013 but I was short of time. Instead, I found the dll file elsewhere and placed it in my system32 folder (not sure if that's recommended). This fixed the problem. However as #slater mentioned, I won't recommend downloading the dll from external website due to security issues.
This is a debug runtime DLL. If (and ONLY if!) you just want to run the debug build of your own application on a system without Visual Studio installed, then you can find the missing DLLs in
C:\Windows\System32 (for 64-bit builds)
C:\Windows\SysWOW64 (for 32-bit builds)
Just keep copying DLLs until your executable will run.
If this is NOT what you are trying to do, refer to https://stackoverflow.com/a/27386721/2279059, which is the CORRECT, but less practical answer.
I had the same problem, I found out that the cause is that I used dll compiled with VS2012 in a VS2013 project. JUST downloaded the missing dll and put it in my linker path and wala: the program worked. I downloaded it from http://www.dll-files.com/.
Particulars: My program was working in in release mode but not in the debug mode as it says the MSVCP110D.dll is missing. My code was an opencv image processing program. I put the missing dll in opencv linker path in the VS2013 project options.

Missing System.Data.SQLite.dll reported after installation

The desktop software (.Net 4.0, compiled under Visual Studio 2010, target: x86) I'm developing is shipping with System.Data.SQLite (1.0.86 for x86, from system.data.sqlite.org*) for the first time.
On the development machine (And every other machine where the System.Data.SQLite-installer has run), everything works correctly.
On the testing machine however, after installation (a standard MSI setup created with the Visual Studio Installer) launching the application and showing the splash screen, before showing the GUI, the application creates an exception with the error:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SQLite.dll' or one of its dependencies.
The mentioned file itself is found in the application directory (correct version), along with all the other referenced DLLs.
I assume this works on the development machines because of the setup option 'Install images'. I didn't install SQLite in the GAC. The application project is directly referencing the pre-build System.Data.SQLite.dll with local copy set to true.
Are there any dependencies I'm not seeing?
Or is it a missing Microsoft Visual C++ Runtime Library (Not present in the application directory)?
Or a missing SQLite.Interop.DLL (Not present in the application directory)?
How could I fix those?
= The installer I've used: http://system.data.sqlite.org/downloads/1.0.86.0/sqlite-netFx40-setup-bundle-x86-2010-1.0.86.0.exe
Ensure that you have the latest Microsoft Visual C++ 2010 Redistributable Package installed.
http://www.microsoft.com/en-gb/download/details.aspx?id=5555
Why? The sqlite DLL has some unmanaged code embedded in it that is run directly from the assembly at runtime. This manifested for me as a bad image format exception but you never know!

Visual studio redistributable & side-by-side / DependentAssembly error

(I'm running Windows7 and using Visual Studio 2010.)
I'm using ClamAV in a .NET Azure project, and I'm running into side-by-side errors whenever I run clamd.exe, either through my code or by running clamd.exe on it's own.
In Visual Studio 2010 I am getting the error:
Win32Exception was unhandled The application has failed to start
because its side-by-side configuration is incorrect. Please see the
application event log or use the command-line sxstrace.exe tool for
more detail
And in Event Viewer I get:
Activation context generation failed for
"C:\Users\pconerly\code\AntiVirus_source\WorkerRole\clamav\clamd.exe".
Dependent Assembly
Microsoft.VC80.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.6195"
could not be found. Please use sxstrace.exe for detailed diagnosis.
When I searched for "8.0.50727.6195" it led me to the 2005 redist, so I downloaded it
http://www.microsoft.com/download/en/details.aspx?id=3387
After a restart I am still getting the side-by-side error. Additionally, I think that the redist installer is not completing it's install-- like it's seeing visual studio 2010 and saying "oh, that's good enough, no need for me to install". I haven't tried uninstalling 2010 and using 2005, because the rest of my Dev team is using VS 2010.
What's the deal? How can this be fixed? I'm ready to pull out my hair.
The link Timores posted is the update for Visual Studio. The actual redistributable package is this:
http://www.microsoft.com/en-us/download/details.aspx?id=26347
The version you mention is actually at found here
Microsoft Visual Studio 2005 Service Pack 1 MFC Security Update
Timores is right: the redist should be this one, which is related to this KB entry
As you can see there, msvcr80.dll has been updated to version 8.0.50727.6195.
It is the "security update" of the "SP1" of the 2005 C++ runtime..
Your exe probably requires (through an internal manifest) that specific version.
If it is not found on the system (there's a lot of places searched for) nor in the current folder (with a suitable manifest aside) it won't load the exe since it is not able to "activate the context", that is load the specific DLL required in the manifest.
I had similar issues when my system got updated (windows updates) and the newly compiled EXEs were not working with an old-versioned runtime placed on the same folder.
I had to update msvcr80.dll and its manifest (which I found deep in \windows\winsxs) to make everything work.
Context activation is a tricky matter, anyway :)
HTH

Resources