Failed to load receiver assembly - FileNotFoundException - visual-studio

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.

Related

Error trying to install Visual Studio Community 2019 Extensions

I just go into Extensions>Manage Extensions>Update, click "Update All" and then close Visual Studio.
The installation just give me a error, i searched online but no clue what's wrong.
Already repaired and reinstalled completely visual studio
Any help? This is the error log.
22/05/2021 22:41:45 - Microsoft VSIX Installer
22/05/2021 22:41:45 - -------------------------------------------
22/05/2021 22:41:45 - vsixinstaller.exe version:
22/05/2021 22:41:45 - 16.9.2017
22/05/2021 22:41:45 - -------------------------------------------
22/05/2021 22:41:45 - Command line parameters:
22/05/2021 22:41:45 - A:\Microsoft Visual Studio\2019\Community\Common7\IDE\vsixinstaller.exe,/appidinstallpath:A:\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe,/skuName:Community,/skuVersion:16.9.31313.79,/appidname:Microsoft Visual Studio Community 2019,/culture:en-US,/noep,C:\Users\erikm\AppData\Local\Temp\VSIXdc234dfy.vsix,C:\Users\erikm\AppData\Local\Temp\VSIXygjj5kfo.vsix,C:\Users\erikm\AppData\Local\Temp\VSIXityxfypz.vsix
22/05/2021 22:41:45 - -------------------------------------------
22/05/2021 22:41:45 - Microsoft VSIX Installer
22/05/2021 22:41:45 - -------------------------------------------
22/05/2021 22:41:45 - System.IO.FileLoadException: Could not load file or assembly 'Microsoft.VisualStudio.Validation, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Microsoft.VisualStudio.Validation, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at VSIXInstaller.SupportedSKUs.AddInstalledIsolatedShells(Version vsVersion, IntPtr userToken)
at VSIXInstaller.SupportedSKUs.InitializeSupportedSKUs(IntPtr userToken)
at VSIXInstaller.ExtensionService.InitializeSupportedSKUs(ICommandLineData cmdLineData, IntPtr duplicatedUserToken)
at VSIXInstaller.App.Initialize(Boolean isRepairSupported)
at VSIXInstaller.App.Initialize()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
After deleting all "Microsoft.VisualStudio.Validation.dll" found by a file explorer search and reinstalling visual studio, it worked!

'Oracle.DataAccess, Version=2.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies

I have a web project built in Visual Studio 2012. Its using the Oracle.DataAccess.dll
Now the one I see in my solution is 4.121 version. But am receiving this error where the project is looking for 2.122 version.
Thanks for your help in advance
Below is the stack trace
=== Pre-bind state information === LOG: DisplayName = Oracle.DataAccess, Version=2.122.1.0, Culture=neutral,
PublicKeyToken=89b483f429c47342 (Fully-specified) LOG: Appbase =
file:///C:/TFS/IVAS/CPTSBaselineCode/FrontEndApplications/CampaignPerformanceTracking/CampaignPerformanceTracking/
LOG: Initial PrivatePath =
C:\TFS\IVAS\CPTSBaselineCode\FrontEndApplications\CampaignPerformanceTracking\CampaignPerformanceTracking\bin
Calling assembly : Aarp.Cpts.DataObjects, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null.
=== LOG: This bind starts in default load context. LOG: Using application configuration file:
C:\TFS\IVAS\CPTSBaselineCode\FrontEndApplications\CampaignPerformanceTracking\CampaignPerformanceTracking\web.config
LOG: Using host configuration file: LOG: Using machine configuration
file from
C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Oracle.DataAccess, Version=2.122.1.0,
Culture=neutral, PublicKeyToken=89b483f429c47342 LOG: Attempting
download of new URL
file:///C:/Users/XXX/AppData/Local/Temp/1/Temporary ASP.NET
Files/vs/ecf130a4/7d736bb0/Oracle.DataAccess.DLL. LOG: Attempting
download of new URL
file:///C:/Users/XXX/AppData/Local/Temp/1/Temporary ASP.NET
Files/vs/ecf130a4/7d736bb0/Oracle.DataAccess/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL
file:///C:/TFS/IVAS/CPTSBaselineCode/FrontEndApplications/CampaignPerformanceTracking/CampaignPerformanceTracking/bin/Oracle.DataAccess.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major
Version ERR: Failed to complete setup of assembly (hr = 0x80131040).
Probing terminated.
Stack Trace:
[FileLoadException: Could not load file or assembly
'Oracle.DataAccess, Version=2.122.1.0, Culture=neutral,
PublicKeyToken=89b483f429c47342' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)]
CampaignPerformanceTracking.JobSearch..ctor() in
c:\TFS\IVAS\CPTSBaselineCode\FrontEndApplications\CampaignPerformanceTracking\CampaignPerformanceTracking\JobSearch.aspx.cs:25
ASP.jobsearch_aspx..ctor() in
c:\Users\XXX\AppData\Local\Temp\1\Temporary ASP.NET
Files\vs\ecf130a4\7d736bb0\App_Web_xghf0hzg.3.cs:0
__ASP.FastObjectFactory_app_web_xghf0hzg.Create_ASP_jobsearch_aspx() in c:\Users\XXX\AppData\Local\Temp\1\Temporary ASP.NET
Files\vs\ecf130a4\7d736bb0\App_Web_xghf0hzg.4.cs:0
System.Web.Compilation.BuildResultCompiledType.CreateInstance() +31
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath
virtualPath, Type requiredBaseType, HttpContext context, Boolean
allowCrossApp) +100
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context,
String requestType, VirtualPath virtualPath, String physicalPath) +31
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext
context, String requestType, VirtualPath virtualPath, String
physicalPath) +64
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String
requestType, VirtualPath path, String pathTranslated, Boolean
useAppConfig) +191
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+156 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +48 System.Web.HttpApplication.ExecuteStep(IExecutionStep
step, Boolean& completedSynchronously) +159
It is a bit difficult to help you if we see only the error message and nothing else. Some points:
Which version of .NET framework did you set in your compile options? If you set 3.5 or lower then your application tries to load Oracle.DataAccess.dll 2.xxx. If you set 4.0 or higher then Oracle.DataAccess.dll 4.xxx will be loaded.
The architecture (i.e. 32-bit or 64-bit) of Oracle.DataAccess.dll must be the same as the architecture if your application
Did you install Oracle.DataAccess.dll (Oracle Data Provider for .NET)? - it is not included in Oracle Instant Client by default.
Version of Oracle.DataAccess.dll must be exactly the same version as your Oracle Client
Oracle installer 12.1 or newer does not add Oracle.DataAccess.dll to GAC. You must add it manually.

The "GenerateResource" task failed unexpectedly. System.InvalidOperationException

After Migrating a project from 2008 to 2012, while build or rebuild facing this issue.
Detailed Error as follows,
Error 2 The "GenerateResource" task failed unexpectedly.
System.InvalidOperationException: The security state of an AppDomain was modified by an AppDomainManager configured with the NoSecurityChanges flag.
at System.AppDomain.SetupDomainSecurity(AppDomainHandle appDomain, ObjectHandleOnStack appDomainEvidence, IntPtr creatorsSecurityDescriptor, Boolean publishAppDomain)
at System.AppDomain.InitializeDomainSecurity(Evidence providedSecurityInfo, Evidence creatorsSecurityInfo, Boolean generateDefaultEvidence, IntPtr parentSecurityDescriptor, Boolean publishAppDomain)
at System.AppDomain.Setup(Object arg)
at System.AppDomain.nCreateDomain(String friendlyName, AppDomainSetup setup, Evidence providedSecurityInfo, Evidence creatorsSecurityInfo, IntPtr parentSecurityDescriptor)
at System.AppDomainManager.CreateDomainHelper(String friendlyName, Evidence securityInfo, AppDomainSetup appDomainInfo)
at System.AppDomainManager.CreateDomain(String friendlyName, Evidence securityInfo, AppDomainSetup appDomainInfo)
at System.AppDomain.InternalCreateDomain(String friendlyName, Evidence securityInfo, AppDomainSetup info)
at System.AppDomain.CreateDomain(String friendlyName, Evidence securityInfo, AppDomainSetup info)
at Microsoft.Build.Tasks.GenerateResource.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
How do I fix this?
The “GenerateResource” task failed unexpectedly. System.InvalidOperationException
(According to the error messages, they are all common errors. I could not give the most direct correct answer for this issue, I can only give you some troubleshootings. In order to avoid losing contact in the round-trip comments, I post those troubleshootings as answer instead of comments.)
To resolve this issue, please try following methods:
Add <NetFx40_LegacySecurityPolicy enabled="true"/> into the VS2012 DevEnv configuration file, you'll find it in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe.config
Adding the following under the first property group in the Project file:
<PropertyGroup>
<GenerateResourceNeverLockTypeAssemblies>true</GenerateResourceNeverLockTypeAssemblies>
</ProjectGroup>
If you have app.config file in your project, please try to add following into it:
<runtime>
<NetFx40_LegacySecurityPolicy enabled="true"/>
<legacyCasPolicy enabled="true"/>
</runtime>
If above not helps you, please try to reinstall the Visual Studio 2012.
Hope this helps.

All probing URLs attempted and failed

I have a visual studio windoes application having N Number of projects.
I am getting the below described error while running my setup.
this error is traced by Fusion log viewer:-
> The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable C:\Program Files (x86)\directory\InstallUtil.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = userdir\Alice.Carroll
LOG: DisplayName = Company.Shared.EnterpriseLibraryExtensions.resources, Version=2.0.0.0, Culture=en, PublicKeyToken=80955c93367666f4
(Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/directory/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files (x86)\directory\InstallUtil.exe.Config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: Company.Shared.EnterpriseLibraryExtensions.resources, Version=2.0.0.0, Culture=en, PublicKeyToken=80955c93367666f4
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/directory/en/Company.Shared.EnterpriseLibraryExtensions.resources.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/directory/en/Company.Shared.EnterpriseLibraryExtensions.resources/Company.Shared.EnterpriseLibraryExtensions.resources.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/directory/en/Company.Shared.EnterpriseLibraryExtensions.resources.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/directory/en/Company.Shared.EnterpriseLibraryExtensions.resources/Company.Shared.EnterpriseLibraryExtensions.resources.EXE.
LOG: All probing URLs attempted and failed.
What may be the cause of this error?

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.

Resources