Xamarin iOS Linker fails on System.Net.Http.Primitives.dll - xamarin

When building my Xamarin iOS (10.4.0.88) project for Release I get the following error when Link SDK assemblies only is enabled. I have Mono version 4.8.0.459
C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(694,3): warning : Aot files could not be copied to the destination directory /Users/markmeyer/Library/Caches/Xamarin/mtbs/builds/ServiceOrdersMobileApps.iOS/295315d462497600265210bd6b0fdce2/obj/iPhone/Release/mtouch-cache/64/Build/Msym/Msym/tmp: Could not start process.
1> --- inner exception
1> System.ComponentModel.Win32Exception (0x80004005): ApplicationName='mono-symbolicate', CommandLine='store-symbols "/Users/markmeyer/Library/Caches/Xamarin/mtbs/builds/ServiceOrdersMobileApps.iOS/295315d462497600265210bd6b0fdce2/bin/iPhone/Release/ServiceOrdersMobileAppsiOS.app.mSYM" "/Users/markmeyer/Library/Caches/Xamarin/mtbs/builds/ServiceOrdersMobileApps.iOS/295315d462497600265210bd6b0fdce2/obj/iPhone/Release/mtouch-cache/64/Build/Msym/Msym/tmp"', CurrentDirectory='', Native error= Cannot find the specified file
1> at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x0018b] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System/System.Diagnostics/Process.cs:737
1> ---
1>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(694,3): warning : Aot files could not be copied to the destination directory /Users/markmeyer/Library/Caches/Xamarin/mtbs/builds/ServiceOrdersMobileApps.iOS/295315d462497600265210bd6b0fdce2/obj/iPhone/Release/mtouch-cache/32/Build/Msym/Msym/tmp: Could not start process.
1> --- inner exception
1> System.ComponentModel.Win32Exception (0x80004005): ApplicationName='mono-symbolicate', CommandLine='store-symbols "/Users/markmeyer/Library/Caches/Xamarin/mtbs/builds/ServiceOrdersMobileApps.iOS/295315d462497600265210bd6b0fdce2/bin/iPhone/Release/ServiceOrdersMobileAppsiOS.app.mSYM" "/Users/markmeyer/Library/Caches/Xamarin/mtbs/builds/ServiceOrdersMobileApps.iOS/295315d462497600265210bd6b0fdce2/obj/iPhone/Release/mtouch-cache/32/Build/Msym/Msym/tmp"', CurrentDirectory='', Native error= Cannot find the specified file
1> at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x0018b] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System/System.Diagnostics/Process.cs:737
1> ---
1> Process exited with code 1, command:
1> /Library/Frameworks/Mono.framework/Versions/Current/bin/mono /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/mono-cil-strip.exe /Users/markmeyer/Library/Caches/Xamarin/mtbs/builds/ServiceOrdersMobileApps.iOS/295315d462497600265210bd6b0fdce2/obj/iPhone/Release/mtouch-cache/64/Build/System.Net.Http.Primitives.dll /Users/markmeyer/Library/Caches/Xamarin/mtbs/builds/ServiceOrdersMobileApps.iOS/295315d462497600265210bd6b0fdce2/bin/iPhone/Release/ServiceOrdersMobileAppsiOS.app/.monotouch-64/System.Net.Http.Primitives.dll
1> Mono CIL Stripper
1> Error: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
1> Parameter name: index
1> at System.Collections.CollectionBase.System.Collections.IList.get_Item (System.Int32 index) [0x00022] in <12e050e5b3d34326a1b4e2e7624e75da>:0
1> at Mono.Cecil.AssemblyNameReferenceCollection.get_Item (System.Int32 index) [0x00006] in <515b8343d4d0423f92114dba6b015690>:0
1> at Mono.Cecil.ReflectionReader.GetExportedTypeScope (Mono.Cecil.Metadata.MetadataToken scope) [0x00043] in <515b8343d4d0423f92114dba6b015690>:0
1> at Mono.Cecil.ReflectionReader.VisitExternTypeCollection (Mono.Cecil.ExternTypeCollection externs) [0x00089] in <515b8343d4d0423f92114dba6b015690>:0
1> at Mono.Cecil.AggressiveReflectionReader.ReadExternTypes () [0x0000c] in <515b8343d4d0423f92114dba6b015690>:0
1> at Mono.Cecil.AggressiveReflectionReader.VisitTypeDefinitionCollection (Mono.Cecil.TypeDefinitionCollection types) [0x0004f] in <515b8343d4d0423f92114dba6b015690>:0
1> at Mono.Cecil.ReflectionReader.VisitModuleDefinition (Mono.Cecil.ModuleDefinition mod) [0x00007] in <515b8343d4d0423f92114dba6b015690>:0
1> at Mono.Cecil.StructureReader.TerminateAssemblyDefinition (Mono.Cecil.AssemblyDefinition asm) [0x00034] in <515b8343d4d0423f92114dba6b015690>:0
1> at Mono.Cecil.AssemblyDefinition.Accept (Mono.Cecil.IReflectionStructureVisitor visitor) [0x0001f] in <515b8343d4d0423f92114dba6b015690>:0
1> at Mono.Cecil.AssemblyFactory.GetAssembly (Mono.Cecil.Binary.ImageReader irv, System.Boolean manifestOnly) [0x00014] in <515b8343d4d0423f92114dba6b015690>:0
1> at Mono.Cecil.AssemblyFactory.GetAssembly (Mono.Cecil.Binary.ImageReader reader) [0x00000] in <515b8343d4d0423f92114dba6b015690>:0
1> at Mono.Cecil.AssemblyFactory.GetAssembly (System.String file) [0x00006] in <515b8343d4d0423f92114dba6b015690>:0
1> at Mono.CilStripper.Program.Main (System.String[] args) [0x00029] in <515b8343d4d0423f92114dba6b015690>:0
1>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(694,3): error : Could not strip assembly /Users/markmeyer/Library/Caches/Xamarin/mtbs/builds/ServiceOrdersMobileApps.iOS/295315d462497600265210bd6b0fdce2/obj/iPhone/Release/mtouch-cache/64/Build/System.Net.Http.Primitives.dll.
1> --- inner exception
1>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(694,3): error : Could not strip assembly /Users/markmeyer/Library/Caches/Xamarin/mtbs/builds/ServiceOrdersMobileApps.iOS/295315d462497600265210bd6b0fdce2/obj/iPhone/Release/mtouch-cache/64/Build/System.Net.Http.Primitives.dll.
1> ---
1> at MonoTouch.Tuner.Stripper.Process (System.String assembly_file, System.String output_file) [0x000ba] in /Users/builder/data/lanes/3985/9975cb17/source/xamarin-macios/tools/mtouch/Stripper.cs:33
1> at Xamarin.Bundler.Target.m__2 (Xamarin.Bundler.Assembly assembly) [0x00065] in /Users/builder/data/lanes/3985/9975cb17/source/xamarin-macios/tools/mtouch/Target.cs:1041
1> at System.Threading.Tasks.Parallel+c__AnonStorey62[TSource,TLocal].<>m__0 (System.Int32 i) [0x00012] in <12e050e5b3d34326a1b4e2e7624e75da>:0
1> at System.Threading.Tasks.Parallel+<ForWorker>c__AnonStorey31[TLocal].<>m__1 () [0x000ed] in <12e050e5b3d34326a1b4e2e7624e75da>:0
I have the following additional mtouch arguments
-cxx -gcc_flags "-lc++" -v -v -v -v
If I turn off the linker everything builds and work fine. I need the linker to work to get my app approved by the app store as it strips out things I don't need (eg. CallKit). Any suggestions?

I've been experiencing the same problem and just found the solution. This appears to be a problem with the current beta versions of Xamarin iOS (10.4) and mono framework.
Assuming that you're not on the stable channel of Xamarin:
Open Xamarin Studio on the Mac and from the main menu click check for updates. Switch back to the stable channel and downgrade your Mono Framework and Xamarin iOS versions to the current releases.
After doing so I was able to build app archive with linking enabled for release in the app store with Xamarin Studio.
If you've been using the Visual Studio for Mac Preview, this version of the Mono Framework isn't compatible with it so you'll have to stick with Xamarin Studio or Visual Studio on Windows.

Related

How to Disable AOT in Xamarin IOS when deploy to iPhone

My solution consists of 3 projects:
My backend project with assembly My_Test_App (portable)
My_Test_App.Android
My_Test_App.iOS
I develop using VS2015 and use mac to build and deploy. It works fine in iOS simulator. My iOS project do not use linker. Also i have LLVM and incremental build already unchecked.
But when i tried to debug to iPhone device, i got this error:
Severity Code Description Project File Line Suppression State
Error Could not AOT the assembly/Users/myMacName/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Release/mtouch-cache/64/Build/My_Test_App.dll' My_Test_App.iOS
My question is:
How do you disable the AOT in the Xamarin.iOS project? When i check the csproj file of the iOS project, it does not have like in the droid project.
Is disabling the AOT the correct way to solve it?
Thank you for answering!
My build log:
1>------ Build started: Project: My_Test_App.Droid, Configuration: Debug Any CPU ------
2>------ Build started: Project: My_Test_App.iOS, Configuration: Debug iPhone ------
1> Consider app.config remapping of assembly "System.Runtime, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.0.0" [] to Version "4.1.0.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.Runtime.dll] to solve conflict and get rid of warning.
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Runtime" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /></dependentAssembly></assemblyBinding>
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
1> My_Test_App.Droid -> D:\Project\2017\Xamarin Test\test-mobile\My Test App\My_Test_App.Droid\bin\Debug\My_Test_App.Droid.dll
2> Generated session id: c7eaf4168fcb1f8aaecd3a6cbb0f37ee
2> Generated build app name: My_Test_App.iOS
2> Connecting to Mac server MTMAC22s-Mac-mini.local...
2> No way to resolve conflict between "System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System.Runtime.Serialization, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
2> Consider app.config remapping of assembly "System.Numerics, Culture=neutral, PublicKeyToken=b77a5c561934e089" from Version "2.0.5.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Xamarin.iOS\v1.0\System.Numerics.dll] to Version "4.0.0.0" [C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll] to solve conflict and get rid of warning.
2> Consider app.config remapping of assembly "System.Net.Http, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "1.5.0.0" [] to Version "4.0.0.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Xamarin.iOS\v1.0\System.Net.Http.dll] to solve conflict and get rid of warning.
2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190.
2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>D:\Project\2017\Xamarin Test\test-mobile\My Test App\My_Test_App.iOS\Renderers\CustomLabelRenderer.cs(143,53,143,69): warning CS0618: 'Label.Font' is obsolete: 'Please use the Font attributes which are on the class itself. Obsoleted in v1.3.0'
2> My_Test_App.iOS -> D:\Project\2017\Xamarin Test\test-mobile\My Test App\My_Test_App.iOS\bin\iPhone\Debug\My_Test_AppiOS.exe
2> Detected signing identity:
2> Code Signing Key: "iPhone Developer: myemail#mycompany.com (HDZY35YSCS)" (6E0C54049FD692EBF4A54BBD72889DC336388268)
2> Provisioning Profile: "iOS Team Provisioning Profile: com.yourcompany.MyTestApp" (8f408fd0-90e0-4031-92e8-a6a56530778a)
2> Bundle Id: com.yourcompany.MyTestApp
2> App Id: F8AZP5FC9H.com.yourcompany.MyTestApp
2> Mono Ahead of Time compiler - compiling assembly /Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/64/Build/System.Net.Primitives.dll
2> AOTID BE85C9F7-62C4-0559-D329-FA98D6ECDAF2
2> Code: 0(0%) Info: 0(0%) Ex Info: 0(0%) Unwind Info: 0(0%) Class Info: 7(2%) PLT: 1(0%) GOT Info: 236(71%) Offsets: 86(26%) GOT: 120
2> Compiled: 0/0 (100%), No GOT slots: 0 (100%), Direct calls: 0 (100%)
2> Output file: '/Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/System.Net.Primitives.dll.arm64.s'.
2> Linking symbol: '_mono_aot_module_System_Net_Primitives_info'.
2> JIT time: 0 ms, Generation time: 0 ms, Assembly+Link time: 0 ms.
2> /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/external/mono/eglib/src/ghashtable.c:549: assertion 'hash != NULL' failed
2> Mono Ahead of Time compiler - compiling assembly /Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/64/Build/System.Xml.ReaderWriter.dll
2> AOTID 77D080C4-2116-2E71-9BA1-0FB994D16E87
2> Code: 0(0%) Info: 0(0%) Ex Info: 0(0%) Unwind Info: 0(0%) Class Info: 7(2%) PLT: 1(0%) GOT Info: 236(71%) Offsets: 86(26%) GOT: 120
2> Compiled: 0/0 (100%), No GOT slots: 0 (100%), Direct calls: 0 (100%)
2> Output file: '/Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/System.Xml.ReaderWriter.dll.arm64.s'.
2> Linking symbol: '_mono_aot_module_System_Xml_ReaderWriter_info'.
2> JIT time: 0 ms, Generation time: 0 ms, Assembly+Link time: 0 ms.
2> /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/external/mono/eglib/src/ghashtable.c:549: assertion 'hash != NULL' failed
2> Mono Ahead of Time compiler - compiling assembly /Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/64/Build/My_Test_AppiOS.exe
2> AOTID 298562A7-A350-2A44-1D0B-2E4FC728F9D1
2> Code: 54748(65%) Info: 456(0%) Ex Info: 19951(23%) Unwind Info: 1136(1%) Class Info: 4700(5%) PLT: 190(0%) GOT Info: 2018(2%) Offsets: 626(0%) GOT: 2872
2> Compiled: 97/97 (100%), No GOT slots: 0 (0%), Direct calls: 15 (37%)
2> Output file: '/Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/My_Test_AppiOS.exe.arm64.s'.
2> Linking symbol: '_mono_aot_module_My_Test_AppiOS_info'.
2> JIT time: 21 ms, Generation time: 25 ms, Assembly+Link time: 0 ms.
2> AOT Compilation exited with code 139, command:
2> MONO_PATH=/Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/64/Build /Library/Frameworks/Xamarin.iOS.framework/Versions/10.3.1.8/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt --aot=mtriple=arm64-ios,data-outfile=/Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/My_Test_App.arm64.aotdata,static,asmonly,direct-icalls,full,soft-debug,dwarfdebug,no-direct-calls,outfile=/Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/My_Test_App.dll.arm64.s "/Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/64/Build/My_Test_App.dll"
2>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(696,3): error : Could not AOT the assembly '/Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/64/Build/My_Test_App.dll'
2> at Xamarin.Bundler.AOTTask.Build () [0x00117] in <e61e7c7e12a34f76bb60aae297cbc79c>:0
2> at Xamarin.Bundler.BuildTask.Execute () [0x00000] in <e61e7c7e12a34f76bb60aae297cbc79c>:0
2> at Xamarin.Bundler.BuildTasks.Execute (Xamarin.Bundler.BuildTask v) [0x00000] in <e61e7c7e12a34f76bb60aae297cbc79c>:0
2> at System.Threading.Tasks.Parallel+<ForEachWorker>c__AnonStorey6`2[TSource,TLocal].<>m__0 (System.Int32 i) [0x00012] in <8f2c484307284b51944a1a13a14c0266>:0
2> at System.Threading.Tasks.Parallel+<ForWorker>c__AnonStorey3`1[TLocal].<>m__1 () [0x000ed] in <8f2c484307284b51944a1a13a14c0266>:0
========== Build: 1 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
You cannot disable AOT on iOS, your project won't work as iDevices do not allow JIT'ing
No unfortunately no.
We'd need a longer build log (add '-v -v -v' as 'mtouch' arguments), but it can happen because the assembly is too big. you might want to enable Linking All Assemblies in the iOS project settings.
See this for additional references: https://forums.xamarin.com/discussion/457/error-could-not-aot-the-assembly-servicestack-text-monotouch-dll

error MSB6006: "cmd.exe" exited with code 21

Question Explaination
I am trying to running a program using cgal4.6.1, boost1.58.0, qt4.8.5 on my win32 PC with VS2010 ultimate. But when I build the solutions, there are errors happen as showing below. I've deploy the cgal etc well. I wondering how to solve this problem? I will appreciate for your solutions
Error Output
1>------ Build started: Project: qmat, Configuration: Debug Win32 ------
1>Build started 7/31/2015 4:07:00 PM.
1>InitializeBuildStatus:
1> Creating "Debug\qmat.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>CustomBuild:
1> Moc'ing GLWidget.h...
1> The device is not ready.
1> Moc'ing medialaxissimplification3d.h...
1> The device is not ready.
1> Uic'ing medial_axis.ui...
1> The device is not ready.
1> Rcc'ing medial_axis.qrc...
1> The device is not ready.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 21.
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.40
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Visual Studio invokes wrong toolchain

EDIT:
I used process Monitor to check, which executable gets invoked. it Looks like it really invokes the vs2008 executables...
https://skydrive.live.com/redir?resid=5062EFE7E0C8ECCC!2722&authkey=!AMdRW6t5aMB3u10&v=3&ithint=photo%2c.PNG
msbuild.exe executes [(12.0)tracker.exe], but gives it [(9.0)cl.exe] as command line Argument...
Any idea, how to solve this?
original
on my work computer, The VS Default templates for c++ produce build Errors. (VS2010, VS2012, VS2013)
It Kind of Looks like it invokes an old Version of the Compiler (unknown Option '/sdl', where sdl probably stands for security development LifeCycle, which has been added with vs2012, if i remember correctly)
OS: Windows 8 (x64)
Installed VS Versions: 2008, 2010, 2012, 2013 (in this order)
i already tried reinstalling vs2013 and resetting the Settings.
VS2010
Visual C++ -> Win32 -> Win32 Console Application (Finish on the first page of the wizard)
1>------ Build started: Project: asd, Configuration: Debug Win32 ------
1>Build started 11.12.2013 00:22:53.
1>PrepareForBuild:
1> Creating directory "c:\users\myusername\documents\visual studio 2010\Projects\asd\Debug\".
1>InitializeBuildStatus:
1> Creating "Debug\asd.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1> stdafx.cpp
1> asd.cpp
1>RC : fatal error RC1106: invalid option: -ologo
1>
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.56
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
VS2013
Visual C++ -> Win32 -> Win32 Console Application (Finish on the first page of the wizard)
1>------ Rebuild All started: Project: ConsoleApplication1, Configuration: Debug Win32 ------
1>cl : Command line warning D9002: ignoring unknown option '/sdl'
1> stdafx.cpp
1>cl : Command line warning D9002: ignoring unknown option '/sdl'
1> ConsoleApplication1.cpp
1>LINK : fatal error LNK1117: syntax error in option 'manifest:embed'
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
If i go to Properties -> Manifest Tool -> Input and Output and Change Embed Manifest from Yes to No, it works (and the warning disappears too)
Visual C++ -> MFC -> MFC Application (Finish on the first page of the wizard)
1>------ Build started: Project: MFCApplication4, Configuration: Debug Win32 ------
1>cl : Command line warning D9002: ignoring unknown option '/sdl'
1> stdafx.cpp
1>cl : Command line warning D9002: ignoring unknown option '/sdl'
1> ViewTree.cpp
1> PropertiesWnd.cpp
1> OutputWnd.cpp
1> MFCApplication4View.cpp
1> MFCApplication4Doc.cpp
1> MFCApplication4.cpp
1>c:\users\myusername\documents\visual studio 2013\projects\mfcapplication4\mfcapplication4\mfcapplication4.cpp(39): error C2065: 'm_dwRestartManagerSupportFlags' : undeclared identifier
1>c:\users\myusername\documents\visual studio 2013\projects\mfcapplication4\mfcapplication4\mfcapplication4.cpp(39): error C2065: 'AFX_RESTART_MANAGER_SUPPORT_ALL_ASPECTS' : undeclared identifier
1>c:\users\myusername\documents\visual studio 2013\projects\mfcapplication4\mfcapplication4\mfcapplication4.cpp(49): error C3861: 'SetAppID': identifier not found
1>c:\users\myusername\documents\visual studio 2013\projects\mfcapplication4\mfcapplication4\mfcapplication4.cpp(86): error C3861: 'EnableTaskbarInteraction': identifier not found
1> MainFrm.cpp
1>c:\users\myusername\documents\visual studio 2013\projects\mfcapplication4\mfcapplication4\mainfrm.cpp(351): error C2653: 'CMFCVisualManagerVS2008' : is not a class or namespace name
1>c:\users\myusername\documents\visual studio 2013\projects\mfcapplication4\mfcapplication4\mainfrm.cpp(356): error C2653: 'CMFCVisualManagerWindows7' : is not a class or namespace name
1> FileView.cpp
1> ClassView.cpp
1> ChildFrm.cpp
1> Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
If i configure a MFC-Dialog based Application (which was my original goal), i get the following error:
1>------ Build started: Project: MFCApplication3, Configuration: Debug Win32 ------
1> stdafx.cpp
1> MFCApplication3Dlg.cpp
1> MFCApplication3.cpp
1> Generating Code...
1>RC : fatal error RC1106: invalid option: -ologo
1>
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
No idea if it helps, but here is a list with all installed MS Software:
https://skydrive.live.com/redir?resid=5062EFE7E0C8ECCC!2721&authkey=!APk3skYPRCffPWQ&ithint=folder%2c
Ok, i found the solution myself.
similar to this (http://social.msdn.microsoft.com/Forums/de-DE/baf613fc-3b24-4f47-9800-38499965e9dc/vs2010-is-using-a-wrong-compiler-Version) question, my "Microsoft.Cpp.Win32.user" property sheet contained references to the vs2008 directories. i have no clue how they got there, but removing them solved my problem.
open View -> Other Windows -> Property Manager
double click on Microsoft.Cpp.Win32.user
go to VC++ Directories
rows which have been changed are bold. on all bold rows, click inside the text field, then on the Dropdown menu select inherit from parent or Project Defaults
I verified that it now uses the correct Compiler by compiling the following snippet:
auto asd = std::make_unique<int>();
make_unique has been added with VS2013.
Anyone have a clue, what changed These values?
The difference between libwinutils.vcxproj and winutils.vcxproj shows the problem.
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> appears before Release|Win32 PropertyGroup.
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
Open winutils.vcxproj, and move <Import ...> after Release|Win32 PropertyGroup, like the following quote:
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
I have successfully built winutils of hadoop-2.7.0-src with VS2012 toolset.

MSBuild on TFS failed - WebDeploy Package

I'm currently working on a build for a project, but I'm facing difficulties with the TFS Build.
I just want to create a zip package, using a TFS Build, with parameters from IIS Express.
CSPROJ configuration:
IIS Express is present on my machine and on the build server (I can access to the *.svc files in the project).
And all is on source control.
When I use the "Build Deployment Package" on my machine, I've got the zip.
When I use the "Build Deployment Package" on the build server, I've got the zip.
When I use the MSBuild's command line on both, I've got the zip.
The command line in question :
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" "C:\WORKSPACES\[...]\Project.csproj" /p:Platform=AnyCPU;Configuration=Release /p:DeployTarget=Package /p:DeployOnBuild=true;DefaultPackageFileName=ZipName.zip
But when I put the same command line in a build, it fails:
"C:\Builds\2\[...]\Project.csproj" (default target) (1) ->
(PackageUsingManifest target) ->
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3009,5): error : Web deployment task failed.(Object of type 'manifest' and path 'C:\Builds\2\Project Release\Binaries\_PublishedWebsites\Project_Package\Project.SourceManifest.xml' cannot be created.) [C:\Builds\2\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3009,5): error : [C:\Builds\2\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3009,5): error : Object of type 'manifest' and path 'C:\Builds\2\Project Release\Binaries\_PublishedWebsites\Project_Package\Project.SourceManifest.xml' cannot be created. [C:\Builds\2\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3009,5): error : One or more entries in the manifest 'sitemanifest' are not valid. [C:\Builds\2\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3009,5): error : Site '' does not exist. [C:\Builds\2\[...]\Project.csproj]
Additional Infos, line 3009 refer to:
<VSMSDeploy Condition="!$(UseMsdeployExe)"
MSDeployVersionsToTry="$(_MSDeployVersionsToTry)"
Source="#(MsDeploySourceProviderSetting)"
Destination="#(MsDeployDestinationProviderSetting)"
DeploymentTraceLevel="$(PackageTraceLevel)"
DisableLink="$(PackageDisableLinks)"
EnableLink="$(PackageEnableLinks)"
DeclareParameterItems="#(_Package_MsDeployDeclareParameters)"
OptimisticParameterDefaultValue="$(EnableOptimisticParameterDefaultValue)"
ImportDeclareParametersItems="$(_VsPackageParametersFile)"
ReplaceRuleItems="#(MsDeployReplaceRules)"
RetryAttempts="$(RetryAttemptsForDeployment)">
I know I'm missing something, but I don't see what... so, if you have suggestions...it will be very welcome! :)
The tfs build did not run with the same account than me when I'm logged on the build server.
Is IIS Express is well launch with a tfs build ?
When I look in C:\Users\svcTfsBuild\Documents, there is no IISExpress directory, like with my user (svcTfsBuild is the service account for TFS Build).
The main goal:
Obtain a zip package with a tfs build with those parameters (parameters.xml within the zip package).
OR
Have a zip package where we can specify Application Pool and Physical Path when importing.
Like this:
<parameters>
<parameter name="IIS Web Application Name" defaultValue="Default Web Site/Project" tags="IisApp">
<parameterEntry kind="ProviderPath" scope="AppHostConfig" match="^ProjectTest/Project$" />
<parameterEntry kind="ProviderPath" scope="contentPath" match="^C:\\WORKSPACES\\[...]\\obj\\Release\\Package\\PackageTmp$" />
<parameterEntry kind="ProviderPath" scope="setAcl" match="^C:\\WORKSPACES\\[...]\\obj\\Release\\Package\\PackageTmp$" />
</parameter>
<parameter name="IIS Web Application Pool Name" defaultValue="ASP.NET v4.0">
<parameterEntry kind="DeploymentObjectAttribute" scope="application" match="application[#applicationPool='Clr4IntegratedAppPool']/#applicationPool" />
</parameter>
<parameter name="IisVirtualDirectoryPhysicalPath" defaultValue="D:\CompanyName\Project" tags="PhysicalPath">
<parameterEntry kind="DestinationVirtualDirectory" scope=".*" match="^C:\\WORKSPACES\\[...]$" />
</parameter>
</parameters>
Note : we can's specify the configuration in a parameters.xml directly on the csproj because the workspace are not the same on our machines, on the tfs build server...
I hope this is clear
EDIT: suggestion from drk
Like you said, I run the command line from the service account, and got this, in particular:
GenerateMsdeployManifestFiles:
Generate source manifest file for Web Deploy package/publish ...
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: The "IsCleanMSDeployPackageNeeded" task failed unexpectedly. [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.Web.Deployment.DeploymentException: Object of type 'package' and path 'C:\WORKSPACES\[...]\obj\Release\Package\Project.zip' cannot be created. ---> Microsoft.Web.Deployment.DeploymentException: The Zip package 'C:\WORKSPACES\[...]\obj\Release\Package\Project.zip' could not be loaded. ---> System.UnauthorizedAccessException: Access to the path 'C:\WORKSPACES\[...]\obj\Release\Package\Project.zip' is denied. [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Web.Deployment.Win32Native.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath) [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Web.Deployment.FileStreamEx.CreateInstance(String path, FileMode fileMode, FileAccess fileAccess, FileShare fileShare) [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Web.Deployment.ZipFile.Load() [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Web.Deployment.ZipPackageProvider..ctor(DeploymentProviderContext providerContext, DeploymentBaseContext baseContext, String path) [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: --- End of inner exception stack trace --- [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Web.Deployment.ZipPackageProvider.GetAttributes(DeploymentAddAttributeContext addContext) [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Web.Deployment.DeploymentObject.EnsureValidAttributes() [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: --- End of inner exception stack trace --- [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Web.Deployment.DeploymentManager.CreateObjectPrivate(DeploymentProviderContext providerContext, DeploymentBaseOptions baseOptions, DeploymentObject sourceObject) [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Web.Deployment.DeploymentManager.CreateObject(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions) [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Web.Deployment.DeploymentManager.CreateObject(String provider, String path, DeploymentBaseOptions baseOptions) [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Web.Deployment.DeploymentManager.CreateObject(DeploymentWellKnownProvider provider, String path) [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: --- End of inner exception stack trace --- [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Web.Publishing.Tasks.DynamicAssembly.CallStaticMethod(String typeName, String methodName, Object[] arguments) [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Web.Publishing.Tasks.IsCleanMSDeployPackageNeeded.Execute() [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\WORKSPACES\[...]\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) [C:\WORKSPACES\[...]\Project.csproj]
Done Building Project "C:\WORKSPACES\[...]\Project.csproj" (default targets) -- FAILED.
Build FAILED.
I've checked the service account (SvcTfsBuild in my case).
He has full control over the workspace (so the source code).
And my account and the SvcTfsBuild account are on the same groups (local administrator).
But the TFS BUILD log (verbose mode) did not show any permission problem...
EDIT 2013/03/25
I've uncheck the checkbox "Use IIS Express" in the Web tab.
The build generate the good zip package.
So, I asume there is a problem only with IIS Express.
In the build, I've had an "InvokeProcess" on the sequence "Run On Agent", just after "CreateLabel".
It launch ISS Express with those arguments :
/site:Project-Site
In the log file, I've got a Result to 0 (so, I assume ISS Express is well launch, if not, it is supposed to throw an exception).
But, if the command line is not well formed or wrong (ie: with /site and /path wich cannot be combined), the result is also 0.
And if I launch ISS Express that way, the build is stopped (iisexpress wait a manual action to stop or just listen).
EDIT 2 2013/03/25
To launch IIS Express in the same time than the build, I've made this :
On the Parallel, I've got a variable named "BuildFinished" wich is set to True in the Finally of the build process (on left).
But, I've again the same error (Site '' does not exist).
I've also find a difference between the two Project.SourceManifest.xml when build through "Build Deployment Package" (in VS2010) and through the TFBUILD.
Build Deployment Package :
<?xml version="1.0" encoding="utf-8"?>
<sitemanifest>
<appHostConfig path="Project-Site/Project" />
<contentPath path="C:\WORKSPACES\Project\obj\Release\Package\PackageTmp" />
<setAcl path="C:\WORKSPACES\Project\obj\Release\Package\PackageTmp" setAclResourceType="Directory" />
<setAcl path="C:\WORKSPACES\Project\obj\Release\Package\PackageTmp" setAclUser="anonymousAuthenticationUser" setAclResourceType="Directory" />
</sitemanifest>
TFBUILD :
<?xml version="1.0" encoding="utf-8"?>
<sitemanifest>
<appHostConfig path="/Project" />
<contentPath path="C:\Builds\1\Project\obj\Release\Package\PackageTmp" />
<setAcl path="C:\Builds\1\Project\obj\Release\Package\PackageTmp" setAclResourceType="Directory" />
<setAcl path="C:\Builds\1\Project\obj\Release\Package\PackageTmp" setAclUser="anonymousAuthenticationUser" setAclResourceType="Directory" />
</sitemanifest>
The path value is not the same.
After a couple of trys, I think the problem is between IIS Express and MSDeploy wich can't work together (this is the one saying "Site '' does not exist.").
So, instead of thrying to make it work, we change our mind to use a configuration wich works: modifying the csproj during the build processs in order to use IIS.
Step 1: IIS on the build server
Create an application pool: the name and the Framework version are the two things that matters. Nothing more.
Create the application: name and application pool are important. You can use C:\temp as physical path.
Step 2: Build's definition
You have two choices: create a custom build activity (better one) or do it inside the xaml (ugly one).
The goal, is to have the followings steps:
On the "Run On Agent" sequence, just after the "If Create Label"
Remove the readonly attribute on the targeted csproj (the one on the workspace created by TFS)
Read the csproj's content
Replace the following XML tags
<UseIISExpress>True</UseIISExpress> by <UseIISExpress>False</UseIISExpress>
<UseIIS>False</UseIIS> by <UseIIS>True</UseIIS>
<IncludeIisSettings>False</IncludeIisSettings> by <IncludeIisSettings>true</IncludeIisSettings>
<IISUrl>{IIS Express URL}</IISUrl> by <IISUrl>{IIS URL}</IISUrl>
/!\ Beware: the booleans can be True or true!
/!\ Beware2: if using Cassini, the IISUrl's tag may have a word wrap, like:
`<IISUrl>
</IISUrl>`
This happened only with one of the 4 dev's machine.
{IIS Express URL}: is like http://localhost:8080/ or http://localhost:8080/Application with IIS Express or empty with Cassini.
{IIS URL}: is like http://localhost/Application.
And finally, overwrite the csproj (remember, the one in the TFS's workspace, not the on on source control) with the modify content.
{IIS Express URL} and {IIS URL} can be arguments from the build, but only if the build take the csproj one by one (1 build = 1 zip package, so 1 csproj have to be modified).
With that solution (I think there is a better one that I don't know), we use a configuration that we know it works.
When the zip package will be import in IIS, the application pool and the physical path can be change.
And this is our goal.
Hope this helps.

win32 programming in c++

i have following code in visual c++
#include<Windows.h>
LPCTSTR Caption=L"Application programming INTERFACE";
INT WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPPREVInstance,
LPSTR lpCmdLINE,int nCmdShow)
{
MessageBox(NULL,L" Welcome to win32 Application Develepment\n",Caption,MB_YESNOCANCEL| MB_ICONQUESTION);
return 0;
}
but errors are
1>------ Build started: Project: win321, Configuration: Debug Win32 ------
1>Build started 7/31/2010 1:28:31 PM.
1>InitializeBuildStatus:
1> Touching "Debug\win321.unsuccessfulbuild".
1>ClCompile:
1> win32.cpp
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>c:\users\david\documents\visual studio 2010\Projects\win321\Debug\win321.exe : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.58
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
If your compiling a windows project then make sure you have the application type selected as 'Windows Application' not 'Console Application'.
Also, VS uses wWinMain if you want to use Unicode.

Resources