I have a very simple MFC application built in VS12. When I’m trying to install it on a Surface tablet (Win 8.1) I’m getting an error about mfc110ud.dll being missing. I looked up this dll and it says “MFCDLL Shared Library - Debug Version”. The problem is I’m building my app in Release mode. Why do I still depend on VS?
Use the linker /verbose Option to find the module or library that requires the DLL Version of the MFC.
See this particular post:
mfc110ud.dll is missing for vc++ project on visual Studio 2012
Potentially a duplicate (recompile with "Use of MFC" as "Use MFC in a static Library" when you compile)
Related
I'm looking for some help to setup my Visual Studio for Mac project properly. I'm new to Visual Studio Mac and would appreciate a shove down the right road.
I have a large class library, originally developed in visual studio 2017 on Windows.I'd like to use much of that code to develop an iOS application. This class library requires references to:
System
System.Runtime.Serialization
System.ServiceModel
System.ServiceModel.Web
System.Web.
I have tried porting that code to a Portable Class Library in Visual Studio for Mac. However PCLs don't allow you to reference the above assemblies (unless I'm missing something).
So I then ported it to .NET Library project (Other -> .NET -> Library) project. However, my iOS app won't allow references to that project type because VS for Mac says it has an "Incompatible Target Framework: .NETFramework, Version-v4.6.1).
What project type should I be using for this class library so that it can reference the needed .NET assemblies and it can be referenced from my iOS application?
Possible options:
Use a different Portable Class Library (PCL) profile.
Use a .NET Standard project.
Use a shared project.
For everything apart from System.Web, there are PCL profiles that have the assemblies you are looking for. You can see which assemblies are available on the Mac by looking in the PCL directory:
/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks/.NETPortable
If you open a terminal window there you can run a search, find . -name "System.ServiceModel.Web.dll", or browse the folders using Finder to find a PCL profile that has the assemblies you need.
Another possibility would be to use a .NET Standard 2.0 project which has a lot of assemblies that can be used and supports being referenced by a Xamarin.iOS project. You may need to install some other System.* NuGet packages to provide the required assemblies.
The namespaces available in .NET Standard 2.0 are documented:
https://learn.microsoft.com/en-us/dotnet/api/?view=netstandard-2.0
Another option is using a shared project. This does not have assembly references itself but is basically shared code that is compiled into all projects that reference it. Here you can use #ifdefs for any code that is iOS or Android specific.
I have a solution with a number of C# projects targeting .Net 4.6 and one native C++ project (no CLR). After using the solution with VS2015 I now get errors when trying to open the solution in VS2013 with half the projects failing to load.
The native C++ project and some of the C# projects give the error:
error : A numeric comparison was attempted on "$(TargetPlatformVersion)" that evaluates to "10.0.10069.0" instead of a number, in condition "'$(TargetPlatformVersion)' > '8.0'". C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets
I'm not sure why some projects correctly load and others don't, however, it does look like all C# projects which reference NuGet packages fail.
Is there a way to fix these errors and allow the solution and projects to be opened in both VS2013 and VS2015?
After trying out various changes to project files I found that removing the following line from the native C++ project then allowed all projects in the solution to load correctly.
<TargetPlatformVersion>10.0.10069.0</TargetPlatformVersion>
However, after loading I then found that I couldn't build the native project because of the error:
error MSB8020: The build tools for v140 (Platform Toolset = 'v140') cannot be found.
Even though the vcxproj specifies ToolsVersion="14.0" it appears that Visual Studio 2013 will use 12.0 for C++ projects. In the project's properties the Platform toolset says v140 (not installed). Changing this to Visual Studio 2013 (v120) would allow the project to build in both VS2013 and VS2015, though obviously using the older 12.0 tools rather than 14.0. Instead I added the following lines to my project file:
<PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0'">v120</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' >= '14.0'">v140</PlatformToolset>
Now VS2013 will use the v120 Platform toolset and VS2105 (and later) will use v140.
After building with VS 2015 the project file may have a TargetPlatformVersion and/or WindowsTargetPlatformVersion line added. If the value is 10.0.10240.0 or another Windows 10 version then the project won't load in VS 2013 as it doesn't like the non-decimal value. This can be fixed by changing the value to 8.1, telling Visual Studio to use the Windows Kit for Windows 8.1 rather than Windows 10.
Note:
Even though you can target .Net 4.6 with VS2013 it doesn't understand C# 6 so will give errors if you try and use any of the new language features. Similarly, targeting v120 for the C++ project prevents you using newer language features supported in VS2015.
I created a MFC project with VS2013 and it works fine on my computer. But it won't run on a computer without VC++ Redistribution 2013 installed.
Can I specify a lower VC++ runtime version of an MFC project in Visual Studio?
I think even if it is lower vc++ runtime version, you may face similar problem.
If you can tolerate exe file is larger than before, just change the value of Use of MFC to Use MFC in a Static Library in project property page. By doing so, you don't need to distribute mfc modules related.
Otherwise, you have to distribute relative mfc modules such as mfc100.dll.
This link may help you.
You need to create installation package for your program. As Visual Studio user, you can create an installation with InstallShield Limited Edition. Installation package should contain correct C++ and MFC runtime version for your program.
See also:
InstallShield Limited Edition http://msdn.microsoft.com/en-us/library/dn531020.aspx\
Walkthrough: Deploying Your Program (C++) http://msdn.microsoft.com/en-us/library/bb384837.aspx
Specifically, to add VC++ Runtime: On the Redistributables tab in the editor window, select the Visual C++ 11.0 CRT check box. If you use MFC, check also MFC redistribution.
I am using CMake 2.8.10.1 to generate project files for Visual Studio 2012 Ultimate (64-bit). The resulting solution contains a library, some tests, and some executables.
I would like to profile some of the applications. When I select "ANALYZE" -> "Start Performance Analysis," I encounter the error message "No launchable projects are available for profiling." How can I profile my solution generated by CMake?
It seems I've found a way to fix it. You need to add win32 configuration under your project. Then profiler will see your project as launchable.
For example, for the release configuration you should add the following
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
under
<ItemGroup Label="ProjectConfigurations">
Using the menu:
Build -> Configuration Manager
Goto row of the project to profile
In the platform column note that it will only have a x64 entry
Use dropdown <New...> and select Win32 for New platform:
-
That's a ridiculous bug in Visual Studio. QMake also suffers from this.
https://connect.microsoft.com/VisualStudio/feedback/details/823467/performance-wizard-doesnt-show-any-projects-to-profile-if-there-is-no-win32-configuration
how can i add Visual C++ Runtime Package to metro style C# app in windows 8? Adding this shows error in project.
In the Add Reference dialog choose the Windows\Extensions view you will see Visual C++ Runtime Package
See this blog post for more details about C++ Runtime package:
http://blogs.msdn.com/b/vcblog/archive/2012/09/28/10354327.aspx