I was attempting to add a 3rd party plug in Formulate to my umbraco site.
Something failed during the installation and I can no longer see any of the entries in the back office tree, although the site still runs.
When setting the config to debug:
(Umbraco version 7.3.4 assembly: 1.0.5820.25371)
Received an error from the server
Failed to retrieve data for application tree users
Value cannot be null.
Parameter name: value
EXCEPTION DETAILS:
System.ArgumentNullException: Value cannot be null.
Parameter name: value
STACKTRACE:
at Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func1 getCacheItem, Nullable1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, CacheDependency dependency)
at Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func1 getCacheItem, Nullable1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, String[] dependentFiles)
at Umbraco.Core.Services.ApplicationTreeService.GetAppTrees()
at Umbraco.Core.Services.ApplicationTreeService.GetApplicationTrees(String applicationAlias, Boolean onlyInitialized)
at Umbraco.Web.Trees.ApplicationTreeController.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.TaskHelpersExtensions.d__3`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()
I heard from Nicholas Westby, the author of Formulate and that got my site back.
Hi James,
I'm guessing you are talking about Formulate (I have made several Umbraco packages). Here's the quick fix:
If you have source control, simply undo the changes made by Formulate. If not, here's a few more steps.
Remove the Formulate DLL's from the bin folder.
Remove Formulate references from the web.config.
Remove Formulate references from any of the files in the config folder (e.g., trees.config, applications.config, dashboard.config).
That should get your site working again. If you'd like some assistance getting Formulate up and running, post a message here and we can start troubleshooting: https://our.umbraco.org/projects/backoffice-extensions/formulate/formulate-questions/
Regards,
Nick
Related
resource "azurerm_analysis_services_server" "server" {
name = "analysisservicesserver"
location = "northeurope"
resource_group_name = azurerm_resource_group.rg.name
sku = "S0"
admin_users = ["mygroup"]
enable_power_bi_service = true
when adding AD group I am getting following error. I am able to add manually via azure portal.
'<pii>adgroup_name</pii>' was not found in your organization's Azure Active Directory. Details: '<pii>The object was not found in Azure Active Directory.</pii>'.\r\n\r\n at Microsoft.AnalysisServices.Core.AnalysisServicesClient.SendExecuteAndReadResponse(ImpactDetailCollection impacts, Boolean expectEmptyResults, Boolean throwIfError)\r\n at Microsoft.AnalysisServices.Core.AnalysisServicesClient.Alter(IMajorObject obj, ObjectExpansion expansion, ImpactDetailCollection impact, Boolean allowCreate, XmlaWarningCollection warnings, JaXmlSerializer serializer)\r\n at Microsoft.AnalysisServices.Core.Server.Update(IMajorObject obj, UpdateOptions options, UpdateMode mode, XmlaWarningCollection warnings, ImpactDetailCollection impactResult)\r\n at Microsoft.AnalysisServices.Core.Server.SendUpdate(IMajorObject obj, UpdateOptions options, UpdateMode mode, XmlaWarningCollection warnings, ImpactDetailCollection impactResult)\r\n at Microsoft.AnalysisServices.MajorObject.Update(UpdateOptions options, UpdateMode mode, XmlaWarningCollection warnings)\r\n at Microsoft.ASPaaS.Service.Common.Utilities.ProvisionUtility.<>c__DisplayClass36_1.<<UpdateAsAdministratorsAsync>b__0>d.MoveNext()\r\n --- End of inner exception stack trace ---\r\n at Microsoft.ASPaaS.Service.Common.Utilities.ProvisionUtility.<>c__DisplayClass36_1.<<UpdateAsAdministratorsAsync>b__0>d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.ServicePlatform.Core.Flow.FlowContextBase`1.VoidActionWrapper.<Action>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.ServicePlatform.Core.Flow.FlowContextBase`1.<ExecuteWithRetry>d__14`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at Microsoft.ServicePlatform.Core.Flow.FlowContextBase`1.<ExecuteWithRetry>d__14`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.ServicePlatform.Core.Flow.FlowContextBase`1.<ExecuteWithRetry>d__13.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.ASPaaS.Service.Common.Utilities.ProvisionUtility.<UpdateAsAdministratorsAsync>d__36.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.ASPaaS.Worker.Service.JobHandlers.FinalizeServerProvisionJobHandler.<FinalizeServerProvisionAsync>d__9.MoveNext() in X:\\bt\\1234738\\repo\\src\\Apps\\WorkerService\\src\\service\\ASPaaS.Worker.Service\\JobHandlers\\FinalizeServerProvisionJobHandler.cs:line 186"
To add Ad groups using terraform try the below snippet:
resource "azuread_group" "server" {
display_name = "analysisservicesserver"
security_enabled = true
location = "northeurope"
resource_group_name = azurerm_resource_group.rg.name
sku = "S0"
admin_users = ["mygroup"]
enable_power_bi_service = true
Instead of giving "azurerm_analysis_services_server" try replacing with "azuread_group"
Try including mail_enabled or security_enabled argument while using azuread_group.
For more information, please refer below links:
Manage Azure Active Directory (Azure AD) Users and Groups | Terraform - HashiCorp Learn
Create Azure Active Directory Groups With Terraform – Learn IT And DevOps Daily (ntweekly.com)
I've followed the steps provided in the SpecFlow livingdoc documentation however when i try to generate LivingDoc, i'm hitting error.
Installed SpecFlow.Plus.LivingDoc.CLI
Tool 'specflow.plus.livingdoc.cli' is already installed.
Navigated to folder where .dll and .json file is located
Test_Project.dll and TestExecution.json is located here.
Executed "livingdoc test-assembly Test_Project.dll -t TestExecution.json"
Error message
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string. (Parameter 'startIndex')
at System.String.Substring(Int32 startIndex, Int32 length)
at System.String.Substring(Int32 startIndex)
at LivingDoc.CLI.Parser.TestAssemblyFeatureFileProvider.<>c__DisplayClass2_0.<GetFeatureFileResources>b__1(String fn) in D:\a\1\s\src\SpecFlow.Integration\LivingDoc.CLI\Parser\TestAssemblyFeatureFileProvider.cs:line 27
at System.Linq.Enumerable.SelectListIterator`2.ToList()
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at LivingDoc.CLI.Parser.TestAssemblyFeatureFileProvider.GetFeatureFileResources() in D:\a\1\s\src\SpecFlow.Integration\LivingDoc.CLI\Parser\TestAssemblyFeatureFileProvider.cs:line 25
at LivingDoc.CLI.Parser.Parser.Parse(String rootNodeTitle, String projectLanguage, String workItemPrefix, String workItemUrlTemplate) in D:\a\1\s\src\SpecFlow.Integration\LivingDoc.CLI\Parser\Parser.cs:line 33
at LivingDoc.CLI.ReportGenerator.Generate(GeneratorSource source, Parameters parameters) in D:\a\1\s\src\SpecFlow.Integration\LivingDoc.CLI\ReportGenerator.cs:line 73
at LivingDoc.CLI.ArgumentResolver.Handle(String workingFolder, GeneratorSource source, Parameters parameters) in D:\a\1\s\src\SpecFlow.Integration\LivingDoc.CLI\ArgumentResolver.cs:line 214
at LivingDoc.CLI.ArgumentResolver.<>c__DisplayClass5_0.<Resolve>b__0(Parameters p) in D:\a\1\s\src\SpecFlow.Integration\LivingDoc.CLI\ArgumentResolver.cs:line 161
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__21_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__22_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__20_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__11_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()
Many thanks in advance :)
Reason behind this issue was, you had set the Platform target version to x86/x64, So the assembly not able to support.
Solution :
Change Platform version to Any CPU => Refer the screenshot for the same.
I face the following issue when when I try to use the Xamarin.Android.Things library, as I get the following error:
Xamarin.Android.Common.Debugging.targets(579, 2): [ADB0010] Deployment failed
Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY: Package couldn't be installed in /data/app/com.companyname.{App}-JGJrV86_aZgUGwbbuAao1w==: Package com.companyname.{App} requires unavailable shared library com.google.android.things; failing!]
at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) in /Users/builder/azdo/_work/451/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Mono.AndroidTools/Internal/AdbOutputParsing.cs:line 346
at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass97_0.<InstallPackage>b__0(Task`1 t) in /Users/builder/azdo/_work/451/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Mono.AndroidTools/AndroidDevice.cs:line 784
at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AndroidDeviceExtensions.<PushAndInstallPackage>d__11.MoveNext() in /Users/builder/azdo/_work/451/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Devices/AndroidDeviceExtensions.cs:line 187
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at AndroidDeviceExtensions.<PushAndInstallPackage>d__11.MoveNext() in /Users/builder/azdo/_work/451/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Devices/AndroidDeviceExtensions.cs:line 203
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Xamarin.AndroidTools.AndroidDeploySession.<InstallPackage>d__116.MoveNext() in /Users/builder/azdo/_work/451/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:line 469
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Xamarin.AndroidTools.AndroidDeploySession.<RunAsync>d__110.MoveNext() in /Users/builder/azdo/_work/451/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:line 221
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Xamarin.AndroidTools.AndroidDeploySession.<RunLoggedAsync>d__108.MoveNext() in /Users/builder/azdo/_work/451/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:line 123
The reason I use this library is that my tested application during paring returns extraPairingVariant = PairingVariantConsent that is part of PairingParams.PairingVariantConsent of Android.Things library ...
Here is example how I use it in my Xamarin.Android mobile app:
case BluetoothDevice.ActionPairingRequest:
{
object obj = intent.GetParcelableExtra(BluetoothDevice.ExtraDevice);
BluetoothDevice device = (obj as BluetoothDevice)!;
var extraPairingVariant = intent.GetIntExtra(BluetoothDevice.ExtraPairingVariant, -1);
switch (extraPairingVariant)
{
case PairingParams.PairingVariantPin:
{
if (TrySetPin(device, "0000"))
{
InvokeAbortBroadcast();
}
}
break;
case PairingParams.PairingVariantPasskeyConfirmation:
case PairingParams.PairingVariantConsent:
{
device.SetPairingConfirmation(true);
}
break;
}
}
I guess maybe Xamarin.Android.Things is not intended to work on Mobile Phone ?
But what should I use then instead of PairingParams.PairingVariantConsent ?
Seems like issue happens because I tried to use his library on Android Mobile Phone where it is not supported ...
As I got, the main intent of this library is to be used on hardware, device where it is installed, like Raspberry Pi, Beagle Bone and etc.
I came across issue with Simulated TempSensor (on Windows). When trying to run it as a module I am getting following error (logs from docker):Using transport Mqtt_Tcp_Only
Unable to find a root certificate file at c:/mnt/edgemodule/edge-device-ca.cert.pem.
Unhandled Exception: System.AggregateException: One or more errors occurred. (One or more errors occurred. (The remote certificate is invalid according to the validation procedure.)) ---> System.AggregateException: One or more errors occurred. (The remote certificate is invalid according to the validation procedure.) ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of inner exception stack trace ---
at Microsoft.Azure.Devices.Client.DeviceClient.<>c.b__79_2(Task t)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SimulatedTemperatureSensor.Program.d__4.MoveNext() in /opt/vsts/work/1/s/edge-modules/SimulatedTemperatureSensor/src/Program.cs:line 105
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Devices.Client.Transport.Mqtt.Util.d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Devices.Client.Transport.Mqtt.MqttIotHubAdapter.d__34.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at SimulatedTemperatureSensor.Program.Main() in /opt/vsts/work/1/s/edge-modules/SimulatedTemperatureSensor/src/Program.cs:line 28
We are developing multiple intranet websites with different functionalities. We plan to have a root project (with some basic functionality) from which the user can navigate to the different other projects.
We plan that all projects of this kind should use the same Layout _Layout.cshtml.
To accomplish this we tried to link the _Layout.cshtml from the "side-projects" to the root project. We used the VS buildin link method as described here: https://stackoverflow.com/a/19862471/9641435
The file is linked without any error-message to the path /Views/Shared/_Layout.cshtml. However if we start one of the site-projects the following error message appears:
An unhandled exception occurred while processing the request.
InvalidOperationException: The layout view '_Layout' could not be
located. The following locations were searched:
/Views/Home/_Layout.cshtml /Views/Shared/_Layout.cshtml
Microsoft.AspNetCore.Mvc.Razor.RazorView.GetLayoutPage(ViewContext
context, string executingFilePath, string layoutPath)
Exception Stack:
InvalidOperationException: The layout view '_Layout' could not be
located. The following locations were searched:
/Views/Home/_Layout.cshtml /Views/Shared/_Layout.cshtml
Microsoft.AspNetCore.Mvc.Razor.RazorView.GetLayoutPage(ViewContext
context, string executingFilePath, string layoutPath)
Microsoft.AspNetCore.Mvc.Razor.RazorView+d__18.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
Microsoft.AspNetCore.Mvc.Razor.RazorView+d__14.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor+d__22.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor+d__21.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
Microsoft.AspNetCore.Mvc.ViewResult+d__26.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+d__19.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+d__24.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResultExecutedContext
context)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next,
ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+d__22.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext
context)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next,
ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+d__17.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+d__15.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
Microsoft.AspNetCore.Builder.RouterMiddleware+d__4.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware+d__7.MoveNext()
We tried to fix it with this solution: https://stackoverflow.com/a/24079584/9641435 but inserting that code did not change anything.
We are searching for a solution to fix the described problem or maybe a better aproach to tackle the overall problem.
I found that the linked .cshtml files do get copied when the site is built but they are copied to the build bin folder. In my Startup.cs I added this extra area route:-
if (Env.IsDevelopment())
{
services.Configure<Microsoft.AspNetCore.Mvc.Razor.RazorViewEngineOptions>(options =>
{
options.AreaViewLocationFormats.Add("/bin/Debug/netcoreapp2.1/Areas/{2}/Views/{1}/{0}.cshtml");
});
}
your path may differ but if you open up the solution you should be able to adapt this answer to work.
I didn't need this step when publishing to the production web server running IIS using WebPublishMethod MSDeploy.
I think you don't have to let the view get copied to the output directory but just have to set the build property to content, resulting in the following code in your csproj file:
<ItemGroup>
<Content Include="..\shared\path\to\_Layout.cshtml" Link="Views/Shared/_Layout.cshtml" />
</ItemGroup>