Unable to Install NServiceBus Host Windows Service - azure

I'm attempting to follow the instructions to install the windows service host using NServiceBus.Host.exe for the VideoStore sample app. I'm following the instructions from the web site.
My application runs fine when doing an F5 session in Visual Studio. It's hosting using the console app mode for the host. When I attempt to use the command line to perform the installation, I get multiple errors.
The command line I'm running is:
NServiceBus.Host.exe /install /serviceName:"VideoStore.Sales"
/displayName:"VideoStore.Sales" /description:"Endpoint for
VideoStore.Sales"
/endpointConfigurationType:"VideoStore.Sales.EndpointConfig,
VideoStore.Sales" /username:".\MySvc" /password:"MyPassword"
NServiceBus.Production
Running this resulted in the following exception:
Initializing the installer in the Install AppDomain
Unhandled Exception: System.InvalidOperationException: Sequence
contains more than one matching element at
System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source,
Func2 predicate) at
System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at
System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at
System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at
NServiceBus.Hosting.Profiles.ProfileManager..ctor(List1
assembliesToScan, IConfigureThisEndpoint specifier, String[] args,
List`1 defaultProfiles)
It turns out, this error is caused because my application is referencing both the NServiceBus.Host assembly as well as the NServiceBus.Hosting.Azure assembly. This is because my application is being deployed both in a Windows environment as well as to an Azure worker role. I can switch between the azure emulator and the console-mode for worker roles without issue simply by changing which projects i'm starting when debugging. (Azure cloud service project vs each of the worker projects.)
I was able to resolve this by deleting the NServiceBus.Hosting.Azure.dll assembly to prevent the assembly scanning from finding it. IMHO, this is a bug. Either allow me to specify the host type explicitly or handle a scenario where multiple types are found.
This stopped the previous exception, and instead introduced a new one:
Unhandled Exception:
System.Configuration.ConfigurationErrorsException: Command line
argument 'endpointConfigurationType' has specified to use the type
'VideoStore.Sales.EndpointConfig, VideoStore.Sales' but that type
could not be loaded. at
NServiceBus.Hosting.Windows.EndpointTypeDeterminer.TryGetEndpointConfigurationTypeFromArguments(HostArguments
arguments, Type& type) in y:\BuildAgent\work
\31f8c64a6e8a2d7c\src\NServiceBus.Hosting.Windows\EndpointTypeDeterminer.cs:line
101 at NServiceBus.Hosting.Windows.Program.Main(String[] args) in
y:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.Hosting.Windows\Program.cs:line
38
Both that type and that assembly exist. I've even verified that .NET is loading the type via enabling fusion loader logging:
The operation was successful. Bind result: hr = 0x0. The operation
completed successfully.
Assembly manager loaded from:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll Running under
executable
C:\Projects\Testing\NServiceBus.Azure.Samples-master\VideoStore.AzureServiceBus.Cloud\VideoStore.Sales\bin\Debug\NServiceBus.Host.exe
--- A detailed error log follows.
=== Pre-bind state information === LOG: DisplayName = VideoStore.Sales (Partial) WRN: Partial binding information was supplied for an
assembly: WRN: Assembly Name: VideoStore.Sales | Domain ID: 1 WRN: A
partial bind occurs when only part of the assembly display name is
provided. WRN: This might result in the binder loading an incorrect
assembly. WRN: It is recommended to provide a fully specified textual
identity for the assembly, WRN: that consists of the simple name,
version, culture, and public key token. WRN: See whitepaper
http://go.microsoft.com/fwlink/?LinkId=109270 for more information and
common solutions to this issue. LOG: Appbase =
file:///C:/Projects/Testing/NServiceBus.Azure.Samples-master/VideoStore.AzureServiceBus.Cloud/VideoStore.Sales/bin/Debug/
LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache
Base = NULL LOG: AppName = NServiceBus.Host.exe Calling assembly :
NServiceBus.Host, Version=4.6.0.0, Culture=neutral,
PublicKeyToken=9fc386479f8a226c.
What am I doing wrong here?
EDIT
I believe I see the issue. Basically, trying to avoid the first error where NServiceBus is resolving multiple Profiles due to the fact it's finding them in both NServiceBus.Core and NServicebus.Hosting.Azure is causing the second error.
This is because in order to load my EndpointConfig type, .NET also needs to load the NServicebus.Hosting.Azure assembly, as it implements AsA_Worker, which lives in NServiceBus.Hosting.Azure.
So be deleting that assembly, I'm preventing it from loading the EndpointConfig.
I'm still unclear as to how to resolve this. I need to get NServiceBus to stop scanning both hosting assemblies. This suggests that christof13's answer is correct, but I'm unable to get NServiceBus to ignore its own assemblies.

The root cause of this issue is that when NServiceBus enumerates profiles available, it scans all available assemblies and then does a LINQ statement to filter them down by type name.
The problem is that there are two NServiceBus.Production profiles, one defined in the NServiceBus.Host.dll, and one in the NServiceBus.Hosting.Azure assembly. Their type names are identical, and so the LINQ SingleOrDefault fails.
The suggestion to filter the assemblies searched wouldn't work because NServiceBus always loads its own assemblies. The filter only applies to my project's assemblies.
I was able to resolve this by creating a custom profile that doesn't have the same name as any other profile defined in any assemblies in my project. Something like:
public class DualCloudLocalProfile : IProfile {}
public class DualCloudLocalProfileHandler : IHandleProfile<DualCloudLocalProfile>
{
public void ProfileActivated()
{
if (LogManager.LoggerFactory is NullLoggerFactory || LogManager.LoggerFactory == null)
{
Configure.Instance.TraceLogger().ConsoleLogger();
}
}
}
public class CloudProfileLoggingHandler : IConfigureLoggingForProfile<DualCloudLocalProfile>
{
public void Configure(IConfigureThisEndpoint specifier)
{
//nothing for now
}
}
Once this was added into my project, I modified the install command to specify the new profile:
NServiceBus.Host.exe /install /serviceName:"VideoStore.Sales" /displayName:"VideoStore.Sales" /description:"Endpoint for VideoStore.Sales" /endpointConfigurationType:"VideoStore.Sales.EndpointConfig, VideoStore.Sales" /username:".\MySvc" /password:"MyPassword" VideoStore.Sales.DualCloudLocalProfile
This resolved the problem. I can now run the project as a cloud service and a NServiceBus.Host.exe hosted service, as well as deploy via the /install command for the host.

You can try to filter the assemblies with one the following methods
Configure.With(string probeDirectory)
Configure.With(params Assembly[] assemblies)
Configure.With(IEnumerable<Type> typesToScan)
By default I think that nservicebus scans all the assemblies in the folder, so if you filter with only the needed assemblies it will prevent from receiving this kind of error
http://docs.particular.net/nservicebus/the-nservicebus-host

Related

.NET Core Keyword not supported: 'server'

The sample application on the following page does not start.
https://learn.microsoft.com/en-us/azure/app-service/tutorial-dotnetcore-sqldb-app?pivots=platform-linux
https://github.com/azure-samples/dotnetcore-sqldb-tutorial
As stated in the documentation
After downloading the sample application and creating the DataBase to connect to, an error will occur when the database migration is executed.
$ export ConnectionStrings__MyDbConnection="Server=tcp:db-host.database.windows.net,1433;Database=coreDB;User ID=<username>;Password=<password>;Encrypt=true;Connection Timeout=30;"
$ dotnet ef database update
Build started...
Build succeeded.
info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
Entity Framework Core 3.1.3 initialized 'MyDatabaseContext' using provider 'Microsoft.EntityFrameworkCore.Sqlite' with options: None
System.ArgumentException: Keyword not supported: 'server'.
at Microsoft.Data.Sqlite.SqliteConnectionStringBuilder.GetIndex(String keyword)
at Microsoft.Data.Sqlite.SqliteConnectionStringBuilder.set_Item(String keyword, Object value)
at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(String value)
at Microsoft.Data.Sqlite.SqliteConnectionStringBuilder..ctor(String connectionString)
at Microsoft.EntityFrameworkCore.Sqlite.Storage.Internal.SqliteDatabaseCreator.Exists()
at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_0.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Keyword not supported: 'server'.
Do you know the cause?
I'm using .NET Core 3.1.
If your intention is really use SQLite then you should check this patterns of connections string:
https://learn.microsoft.com/en-us/dotnet/standard/data/sqlite/connection-strings
If not, your code is accidentally calling the SQLite extension to configure your DbContext... Do a full search (Ctrl+Shift+F) in the entire solution for UseSqlite method and replace it for the desired database provider extension (probably will require a new package reference to your project)
The cause was that SQlite was specified where SQL server should be specified.
services.AddDbContext<MyDatabaseContext>(options =>
options. UseSqlite(Configuration.GetConnectionString("MyDbConnection")));
services.AddDbContext<MyDatabaseContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("MyDbConnection")));
Thank you for your cooperation.

Binding Redirection in Azure Automation Account PowerShell Runbook

I'm in need of some help in setting up PowerShell binding redirection within an Azure Automation Account Runbook.
Essentially my Runbook calls a number of methods within two 3rd party .Net dlls, both provided by the same author. One of the dlls has a dependency on Newtonsoft.Json V12.0.1 and the other has a dependency on IdentityModel V4.0.0 which in turn has a dependency on Newtonsoft.Json V11.0.2. My Azure environment uses Windows PowerShell Desktop V5.1.15063.726. Before I do any work in my Runbook I call a function that loads all of the dlls in my imported module (the function calls the [System.Reflection.Assembly]::LoadFrom() method for each dll). I have verified that my imported dlls, including the Newtonsoft.Json.dll V12.0.1 have loaded successfully.
As expected, when Runbook execution hits a line that calls one of the 3rd party dll methods that needs the IdentityModel.dll an exception is thrown:
Exception calling "GetResult" with "0" argument(s): "Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified." System.IO.FileNotFoundException.
This is a known issue and the consensus so far seems to be that I need to create and attach an event handler in PowerShell. One of the proposed solutions can be found here. My problem is with the line that attempts to attach the handler:
[System.AppDomain]::CurrentDomain.add_AssemblyResolve($onAssemblyResolveEventHandler)
When my Runbook hits this line the following exception is thrown:
Cannot find an overload for "add_AssemblyResolve" and the argument count: "1". TargetSite: Void CheckActionPreference(System.Management.Automation.Language.FunctionContext, System.Exception) StackTrace: at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
I can confirm that very limited testing seems to prove the code works in Windows 8.1 using the PowerShell ISE. I have searched extensively to see if there is a difference between how this code should be written in Azure and Windows Desktop, but no luck. Can anyone see what I am doing wrong? Am I missing any DLLs or using statements from my PowerShell script? If it is not possible to redirect binding in this way can anyone help with an alternative technique?
A code extract showing the creation and attachment of the event handler follows:
# Intercept resolution of binaries
$onAssemblyResolveEventHandler = [System.ResolveEventHandler]
{
param($sender, $e)
Write-Host "ResolveEventHandler: Attempting FullName resolution of $($e.Name)"
foreach($assembly in [System.AppDomain]::CurrentDomain.GetAssemblies())
{
if ($assembly.FullName -eq $e.Name)
{
Write-Host "Successful FullName resolution of $($e.Name)"
return $assembly
}
}
Write-Host "ResolveEventHandler: Attempting name-only resolution of $($e.Name)"
foreach($assembly in [System.AppDomain]::CurrentDomain.GetAssemblies())
{
# Get just the name from the FullName (no version)
$assemblyName = $assembly.FullName.Substring(0, $assembly.FullName.IndexOf(", "))
if ($e.Name.StartsWith($($assemblyName + ",")))
{
Write-Host "Successful name-only (no version) resolution of $assemblyName"
return $assembly
}
}
Write-Host "Unable to resolve $($e.Name)"
return $null
}
# Attach event handler
# This is the line that fails.
[System.AppDomain]::CurrentDomain.add_AssemblyResolve($onAssemblyResolveEventHandler)
I haven't been able to resolve the problem with getting binding redirection working in an Azure Automation Account - PowerShell runbook environment, but the author of the two 3rd party .Net dlls has kindly agreed to use NewtonSoft.Json version 11.0.2 for both dlls, so my problem disappears.

Using In-Proc COM DLL with Azure Function

Is it possible to use an In-Proc COM DLL with Azure Functions?
I am migrating my web service to Azure Functions. One of the components has a dependency on a legacy 32-bit COM DLL. This would normally require the DLL to be regsvr32-ed on the system where it will be used. As that seems not possible with Azure Functions is it possible to use such legacy implementations?
Or would it be necessary to revert to a classic cloud service to support this? (My preference would be use the Consumption service plan and benefit from "serverless" architecture.)
Steps:
Create new Azure Function App
Add new Azure Function (http trigger)
Add reference to 32-bit COM component
Call simple test method on COM component
Run locally - works fine
Publish Azure Function
Open function http path - Azure Function fails
Error log reports exception:
Could not load file or assembly 'Interop.MyCOMLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Exception while executing function: Legacy
Microsoft.Azure.WebJobs.Host.FunctionInvocationException : Exception
while executing function: Legacy ---> System.IO.FileNotFoundException
: Could not load file or assembly 'Interop.MyCOMLib, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
system cannot find the file specified. at async
Functions.Legacy.Run(HttpRequestMessage req,TraceWriter log) at
System.Runtime.CompilerServices.AsyncTaskMethodBuilder 1.Start[TStateMachine](TStateMachine&
stateMachine) at Functions.Legacy.Run(HttpRequestMessage
req,TraceWriter log) at lambda_method(Closure ,Legacy ,Object[] )
at
Microsoft.Azure.WebJobs.Host.Executors.TaskMethodInvoker 2.InvokeAsync(TReflected
instance,Object[] arguments) at async
Microsoft.Azure.WebJobs.Host.Executors.FunctionInvoker 2.InvokeAsync[TReflected,TReturnValue](Object
instance,Object[] arguments) at async
Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.InvokeAsync(IFunctionInvoker
invoker,ParameterHelper parameterHelper,CancellationTokenSource
timeoutTokenSource,CancellationTokenSource
functionCancellationTokenSource,Boolean throwOnTimeout,TimeSpan
timerInterval,IFunctionInstance instance) at async
Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithWatchersAsync(IFunctionInstance
instance,ParameterHelper parameterHelper,TraceWriter
traceWriter,CancellationTokenSource functionCancellationTokenSource)
at async
Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(??)
at async
Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(??)
End of inner exception
Also, if I go to the solution's Dependencies | COM then select the Interop.Lib and select to Embed Interop Types then with this change, after publish, on calling the publushed function:
"Retrieving the COM class factory for component with CLSID {D84F92D7-FFFF-4C16-B939-EC98E3A6EBC0} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))."
Thus, the challenge is how to register the COM classes with Azure Functions?
It seems that it is not possible to run regsvr32 on function app platform, when running command on Kudu console, it shows "Access Denied".
The solution is to:
1- Create small web service that use COM lib and consume its functionality and host this app on windows VM.
2- Host other part of your you code in function app and instead of reference the function APP to COM , you can call the hosted web service (and pass whatever parameters you want )
Or simply you can deploy full code on VM and don’t use Function APP.
(Thanks to Microsoft support for this answer).
There is nothing special involved in loading a COM object in a process. The process already loads a ton of random windows COM objects already. Give it a try and see if it works.
(not enough reputation to post comments)

Performance testing in Dynamics 365 for Operations - no endpoint listening

Short error description:
Ms.Dynamics.Performance.CreateUsers.exe from PerfSDK throws error
There was no endpoint listening at https://mytest.sandbox.operations.dynamics.com/Services/AxUserManagement/Service.svc/ws2007FedHttp that could accept the message.
Long error description:
I have created a single user C# test from an XML recording and run it with PerfSDK successfully as described in the first part of the PerfSDK and multiuser testing with Visual Studio Online guide.
I am having trouble running multiuser load tests as described in the second part of the lab. The link above seems to be the only resource online describing how a multiuser test can be created from a singleuser test and how Visual Studio Online can be used to run it in a sandbox environment. I've also watched a few videos such as Tools to Measure and Improve Microsoft Dynamics AX Performance, Performance Tools and the like, but none of them explains all the steps that need to be taken in as much detail as the above article.
I've done the following:
Created a recording of a scenario with Task Recorder in Dynamics 365
for Operations.
Created C# perf test from recording in Visual Studio using the
PerfSDKSample project from the PerfSDK folder.
Followed all 'Steps to run single user performance test with Perf
SDK' from the article;
Built the solution and successfully ran my test from Test Explorer:
Internet Explorer opened starting and replaying the scenario that I
had recorded.
Note: I used DEV environment usnconeboxax1aos.cloud.onebox.dynamics.com for testing. When I tried using another hostname in CloudEnvironment.Config (a sandbox, e.g. mysandbox.sandbox.operations.dynamics.com), the singleuser test failed with the following error message:
System.TypeInitializationException: The type initializer for 'MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement' threw an exception. ---> System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at https://mysandbox.sandbox.operations.dynamics.com/Services/AxUserManagement/Service.svc/ws2007FedHttp that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.Net.WebException: The remote server returned an error: (404) Not Found..
For multiuser testing, I launched Visual Studio from Visual Studio
Online portal https://app.vssps.visualstudio.com/profile/view
I modified the TestSetup method as follows:
Single-user TestSetup:
public void TestSetup()
{
SetupData();
_userContext = new UserContext(UserManagement.AdminUser);
Client = DispatchedClient.DefaultInstance;
Client.ForceEditMode = false;
Client.Company = "GB01";
Client.Open();
}
Multi-user TestSetup:
public void TestSetup()
{
var testroot = System.Environment.GetEnvironmentVariable("DeploymentDir");
if (string.IsNullOrEmpty(testroot))
{
testroot = System.IO.Directory.GetCurrentDirectory();
}
Environment.SetEnvironmentVariable("testroot", testroot);
if (this.TestContext != null)
{
timerProvider = new TimerProvider(this.TestContext);
}
SetupData();
_userContext = new UserContext(UserManagement.AdminUser);
Client = new DispatchedClientHelper().GetClient();
Client.ForceEditMode = false;
Client.Company = "GB01";
Client.Open();
}
I set the HostName in CloudEnvironment.Config to the sandbox URL e.g. mysandbox.sandbox.operations.dynamics.com.
Logged in to the sandbox machine and installed the certificate I had generated earlier for the single-user testing.
Updated wif.config on the sandbox machine in the same way it had been updated in DEV earlier, and restarted IIS.
Double-clicked vsonline.testsettings in Solution Explorer and used the settings recommended in the above article (accordingly modified for my certificate and test scenario).
Opened SampleLoadTest.loadtest from Solution Explorer and tweaked it to use only my test in the Test Mix node, reduced test duration and user count.
Run the load test.
The load test ended with a few errors. The first TestError is the same as mentioned above:
Initialization method MS.Dynamics.Performance.Application.TaskRecorder.GenJnlBase.TestSetup threw exception. System.TypeInitializationException: System.TypeInitializationException: The type initializer for 'MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement' threw an exception. ---> System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at https://mysandbox.sandbox.operations.dynamics.com/Services/AxUserManagement/Service.svc/ws2007FedHttp that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.Net.WebException: The remote server returned an error: (404) Not Found..
Finally, even though I was able to run Ms.Dynamics.Performance.CreateUsers.exe on my DEV machine successfully (a number of test AX users were created in usnconeboxax1aos.cloud.onebox.dynamics.com), when the sandbox environment URL was set in CloudEnvironment.Config, Ms.Dynamics.Performance.CreateUsers.exe failed with same error:
C:\PerfSDK>Ms.Dynamics.Performance.CreateUsers.exe 3 GB01
Failed with the following error:
System.TypeInitializationException: The type initializer for 'MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement' threw an exception. ---> System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at https://mytest.sandbox.operations.dynamics.com/Services/AxUserManagement/Service.svc/ws2007FedHttp that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
...
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at MS.Dynamics.TestTools.CloudCommonTestUtilities.AxUserManagementServiceReference.IAxUserManagement.EnumUsers()
at MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement.PopulateAxUsers()
at MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement..cctor()
--- End of inner exception stack trace ---
at MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement.get_AdminUser()
at MS.Dynamics.Performance.CreateUsers.Program.Main(String[] args)
As per the walkthrough,
If you have an ARR-enabled environment, i.e. you have 2 endpoints like
this:
apr-arr8aossoap.axcloud.test.dynamics.com
apr-arr8aos.axcloud.test.dynamics.com
You would need to enter both endpoints in CloudEnvironment.Config
The no endpoint listening error can be resolved by specifying correct SOAP hostname, e.g.
<ExecutionConfigurations Key="HostName" Value="mysandbox.sandbox.operations.dynamics.com" />
<ExecutionConfigurations Key="SoapHostName" Value="mysandboxaossoap.sandbox.operations.dynamics.com" />

Exception when running Azure Cloud Project

I have created an azure cloud project in visual studio.
1) Used the "Convert to Azure" feature.
2) Added a Https endpoint and certificate.
Attempting to run the project with the azure emulator locally "without debug" the emulator hangs. If I run the project with debugging it seems to start but i get the following exception:
A first chance exception of type 'System.ServiceModel.FaultException`1' occurred in System.ServiceModel.dll
Additional information: Invalid name.
Parameter name: name
After the exception sites fails to continue.
I was wondering if anyone has experienced this issue and how they resolved it?
Additional Information:
.net 4.5.1 framework.
IIS: version 7.5
Azure SDK 2.6
So looking into the WaIISHost.Log I have found the following exception which keeps being thrown:
WaIISHost Information: 0 : [00014196:00000001, 2015/07/15 07:45:38.428,ERROR] Exception:System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDeta il]: Invalid name.
Parameter name: name (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.ArgumentException: Invalid name.
Parameter name: name
at System.Security.AccessControl.NativeObjectSecurity.CreateInternal(ResourceType resourceType, Boolean isContainer, String name, SafeHandle handle, AccessControlSections includeSections, Boolean createByName, ExceptionFromErrorCode exceptionFromErrorCode, Object exceptionContext)
at System.Security.AccessControl.FileSystemSecurity..ctor(Boolean isContainer, String name, AccessControlSections includeSections, Boolean isDirectory)
at System.Security.AccessControl.DirectorySecurity..ctor(String name, AccessControlSections includeSections)
at System.IO.DirectoryInfo.GetAccessControl(AccessControlSections includeSections)
at Microsoft.WindowsAzure.ServiceRuntime.IISConfigurator.FileManager.AddAllowAceIte rative(DirectoryInfo dir, FileSystemRights rights, IdentityReference[] accounts)
at Microsoft.WindowsAzure.ServiceRuntime.IISConfigurato...).
I found a solution to my issue in the end.
I'll be completely honest, i'm not entirely sure if its due to long path names as suggested by #spender or if its something else. I had a folder on my C drive called Dev:
C:\Dev\AzureSolutionExample\Source
I basically moved it directly onto the C drive and everything started working.
C:\AzureSolutionExample\Source

Resources