Is it Possible Publishing A Single EXE File in .net core 2.2 - .net-core-2.2

project built on .net core 2.2.want to publish single EXE file .not able to publish as single EXE file.
i tried the below command in Package console
dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true
Restore completed in 995.93 ms for C:\Demo\New
folder\BHHS\Importer\Importer.csproj.
You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
Importer -> C:\Demo\New folder\BHHS\Importer\bin\Release\netcoreapp2.2\win-x64\Importer.dll
C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(807,5):
error MSB4018: The "GenerateBundle" task failed unexpectedly.[C:\Demo\New
folder\BHHS\Importer\Importer.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview8-
013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(807,5):
error MSB4018:
Microsoft.NET.HostModel.AppHost.PlaceHolderNotFoundInAppHostException:
Exception of type
'Microsoft.NET.HostModel.AppHost.PlaceHolderNotFoundInAppHostException'
was thrown. [C:\Demo\New folder\BHHS\Importer\Importer.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(807,5):
error MSB4018: at Microsoft.NET.HostModel.AppHost.BinaryUtils.SearchAndReplace(MemoryMappedViewAccessor accessor, Byte[] searchPattern, Byte[] patternToReplace, Boolean pad0s) [C:\Demo\New folder\BHHS\Importer\Importer.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(807,5):
error MSB4018: at Microsoft.NET.HostModel.AppHost.BinaryUtils.SearchAndReplace(String filePath, Byte[] searchPattern, Byte[] patternToReplace, Boolean pad0s) [C:\Demo\New folder\BHHS\Importer\Importer.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(807,5):
error MSB4018: at Microsoft.NET.HostModel.AppHost.HostWriter.SetAsBundle(String appHostPath, Int64 bundleHeaderOffset) [C:\Demo\New folder\BHHS\Importer\Importer.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(807,5):
error MSB4018: at Microsoft.NET.HostModel.Bundle.Bundler.GenerateBundle(IReadOnlyList`1 fileSpecs) [C:\Demo\New folder\BHHS\Importer\Importer.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(807,5):
error MSB4018: at Microsoft.NET.Build.Tasks.GenerateBundle.ExecuteCore() in /_/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs:line 36 [C:\Demo\New folder\BHHS\Importer\Importer.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(807,5):
error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() in /_/src/Tasks/Common/TaskBase.cs:line 38 [C:\Demo\New folder\BHHS\Importer\Importer.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(807,5):
error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\Demo\New folder\BHHS\Importer\Importer.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(807,5):
error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [C:\Demo\New folder\BHHS\Importer\Importer.csproj]

No. This is possible only with .NET Core 3.0 onward. See details here - https://devblogs.microsoft.com/dotnet/announcing-net-core-3-0-preview-5/
There is Scott Hanselman blog post about it too - https://www.hanselman.com/blog/MakingATinyNETCore30EntirelySelfcontainedSingleExecutable.aspx

Related

Why can't I install Microsoft Visual Studio Installer Projects?

So i'm trying to install this package to create Setup.exe for my project, but it goes with error:
Install log:
12.06.2021 15:47:52 - Microsoft VSIX Installer
12.06.2021 15:47:52 - -------------------------------------------
12.06.2021 15:47:52 - vsixinstaller.exe version:
12.06.2021 15:47:52 - 16.9.2017
12.06.2021 15:47:52 - -------------------------------------------
12.06.2021 15:47:52 - Command line parameters:
12.06.2021 15:47:52 - C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\vsixinstaller.exe,/appidinstallpath:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe,/skuName:Community,/skuVersion:16.9.31229.75,/appidname:Microsoft Visual Studio Community 2019,/culture:ru-RU,/noep,C:\Users\Admin\AppData\Local\Temp\VSIXabkei5yl.vsix
12.06.2021 15:47:52 - -------------------------------------------
12.06.2021 15:47:52 - Microsoft VSIX Installer
12.06.2021 15:47:52 - -------------------------------------------
12.06.2021 15:47:53 - System.IO.FileLoadException: Не удалось загрузить файл или сборку "Microsoft.VisualStudio.Validation, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" либо одну из их зависимостей. Найденное определение манифеста сборки не соответствует ссылке на сборку. (Исключение из HRESULT: 0x80131040)
Имя файла: 'Microsoft.VisualStudio.Validation, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
в VSIXInstaller.SupportedSKUs.AddInstalledIsolatedShells(Version vsVersion, IntPtr userToken)
в VSIXInstaller.SupportedSKUs.InitializeSupportedSKUs(IntPtr userToken)
в VSIXInstaller.ExtensionService.InitializeSupportedSKUs(ICommandLineData cmdLineData, IntPtr duplicatedUserToken)
в VSIXInstaller.App.Initialize(Boolean isRepairSupported)
в VSIXInstaller.App.Initialize()
в System.Threading.Tasks.Task`1.InnerInvoke()
в System.Threading.Tasks.Task.Execute()
--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---
в Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
Edit: edited and added error window in english so it'll be more understandable
So if anyone'll encounter this problem, i repaired Visual Studio in Visual Studio installer and it actually helped!

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

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.

Failed to load receiver assembly - FileNotFoundException

Struggling with this, project builds and deploys when I don't have EventReceivers in my Features, and fails when I do. I'm not entirely sure which file the FileNotFoundException is referring to
Error given in visual studio
Error 1 Error occurred in deployment step 'Activate Features': Failed to load receiver assembly "Decisions.Features, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8d09acb153961cfd" for feature "Decisions.Features_DeployDecisionCommittee" (ID: 779492d8-f053-45ce-8340-5fa6d7f87a90).: System.IO.FileNotFoundException: Could not load file or assembly 'Decisions.Features, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8d09acb153961cfd' or one of its dependencies. The system cannot find thefile specified.
File name: 'Decisions.Features, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8d09acb153961cfd'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()
=== Pre-bind state information ===
LOG: DisplayName = Decisions.Features, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8d09acb153961cfd
(Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/
LOG: Initial PrivatePath = C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\SharePoint\VstspCache7880
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\SharePoint\vssphost5.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Decisions.Features, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8d09acb153961cfd
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
0 0 Decisions.Features
Assembly Binging Log Viewer
* Assembly Binder Log Entry (25/04/2014 # 11:11:41) *
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\SharePoint\vssphost5.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = Decisions.Features, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8d09acb153961cfd
(Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/
LOG: Initial PrivatePath = C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\SharePoint\VstspCache7880
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = vssphost5.exe
Calling assembly : (Unknown).
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\SharePoint\vssphost5.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Decisions.Features, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8d09acb153961cfd
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/Decisions.Features.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/Decisions.Features/Decisions.Features.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/VstspCache7880/Decisions.Features.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/VstspCache7880/Decisions.Features/Decisions.Features.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/PublicAssemblies/Decisions.Features.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/PublicAssemblies/Decisions.Features/Decisions.Features.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/Decisions.Features.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/Decisions.Features/Decisions.Features.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/VstspCache7880/Decisions.Features.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/VstspCache7880/Decisions.Features/Decisions.Features.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/PublicAssemblies/Decisions.Features.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/PublicAssemblies/Decisions.Features/Decisions.Features.EXE.
LOG: All probing URLs attempted and failed.
Help
This is what worked for me,
First resolution:
· Retract the Solution/WSP in VS.
· Close VS.
· Reopen VS and deploy the Project.
Second resolution:
If closing VS after retraction doesn't solve the problem then a larger workaround is:
· Redeploy the project -> This will show an error during feature activation.
· Go to SharePoint UI and Activate and then Deactivate the deployed feature that was showing activation error in VS.
· Retract the Solution/WSP in VS.
· Close VS.
· Reopen VS and deploy the Project.
http://support.microsoft.com/kb/2022443
This works for me.
Right click on the project and select properties. In the properties menu, choose signing. While in the signing tab, under choose a strong name key file select new and key in a key name. Then select no password needed. After all is done rebuild the file and you can start deploying.
This worked for me: Change the version of your VS project in assembly information. For example, i changed the assembly and file version to 1.1.0.0 instead of 1.0.0.0.
Deployed and no problems.
Afterwards i could just set it back to 1.0.0.0 and continue on deploying without errors or problems...
Another solution which helped me:
Go to the site you are deploying to, and activate feature from UI.
Redeploy from Visual Studio.

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.

Visual Studio crashes when typing in editor

I have been using VS2010 for a few weeks but for the past few days it has been totally unusable. When I type anything into the editor Visual Studio throws an exception, then I get lots of intellisence errors (the code is fine, I can compile it if I run before trying to use the editor) - here is the log message:
<entry>
<record>241</record>
<time>2011/01/25 08:30:34.109</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.InvalidCastException: Unable to cast COM object of type &apos;System.__ComObject&apos; to interface type &apos;Microsoft.VisualStudio.TextManager.Interop.IVsTextReplaceEvents&apos;. This operation failed because the QueryInterface call on the COM component for the interface with IID &apos;{CF9928D9-65AE-4319-A446-94ED5C45ECDE}&apos; failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, Boolean& pfNeedsRelease)
at Microsoft.VisualStudio.TextManager.Interop.IVsTextReplaceEvents.OnReplace(ChangeInput[] pCI)
at Microsoft.VisualStudio.Editor.Implementation.VsTextBufferAdapter.OnTextBufferChangedHighPriority(Object sender, TextContentChangedEventArgs e)
at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args)</description>
</entry>
<entry>
<record>242</record>
<time>2011/01/25 08:30:34.125</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.InvalidCastException: Unable to cast COM object of type &apos;System.__ComObject&apos; to interface type &apos;Microsoft.VisualStudio.Editor.Implementation.IVsTextStreamEvents_Private&apos;. This operation failed because the QueryInterface call on the COM component for the interface with IID &apos;{96FC7D44-BCDD-4F00-AE4D-07E26B2C0E52}&apos; failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, Boolean& pfNeedsRelease)
at Microsoft.VisualStudio.Editor.Implementation.IVsTextStreamEvents_Private.OnChangeStreamText(Int32 iPos, Int32 iOldLen, Int32 iNewLen, Int32 fLast)
at Microsoft.VisualStudio.Editor.Implementation.VsTextBufferAdapter.OnTextBufferChanged(Object sender, TextContentChangedEventArgs e)
at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args)</description>
</entry>
This seems like it might be due to some info missing from the registry on your computer. If you go to the MS Connect website you'll find a discussion about this issue and what seems to be a solution as well.
Solution (copied from that page):
Using regedit look at the following key:
On 32-Bit Windows: [HKEY_CLASSES_ROOT\CLSID\{73B7DC00-F498-4ABD-AB79-D07AFD52F395}\InProcServer32]
On 64-Bit Windows: [HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{73B7DC00-F498-4ABD-AB79-D07AFD52F395}\InProcServer32]
The "(Default)" value should be one of the following:
On 32-Bit Windows: "C:\Program Files\Common Files\Microsoft Shared\MSEnv\TextMgrP.dll"
On 64-Bit Windows: "C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\TextMgrP.dll"
Looks like a problem with an extension or add in. Disable them all then re-enable one by one and see if one of them is acting up..

Resources