Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Pathini 7 posts 77 karma points
    Oct 31, 2023 @ 11:05
    Pathini
    0

    Surface controllers in umbraco 10

    hi,

    I'm bit stuck on using a surface controllers in my new umbraco 10 project. what I want is develop some forms to handle data and render in umbraco site without adding lots of document types for forms.

    I would like to have pluginbase surface controllers project to develop the forms and data submit actions and then call them inside rich text editor using macro.

    I have a done this in umbraco 7 but , couldn't find clear guide lines ,how to do this in umbraco 10. I have copied dll to bin folder , and created App_Plugins folder/surfacecontroller/Views to store views and run build the site using dotnet watch and id doesn't like my dll file . it returns could not load file or assembly error

    unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'PatsSurfaceControllers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL'. The system cannot find the file specified.
    File name: 'PatsSurfaceControllers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL'
       at System.Reflection.RuntimeAssembly.InternalLoad(ObjectHandleOnStack assemblyName, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, Boolean throwOnFileNotFound, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack retAssembly)
       at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, RuntimeAssembly requestingAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, AssemblyLoadContext assemblyLoadContext)
       at System.Reflection.Assembly.Load(AssemblyName assemblyRef) ......
    

    I have read the pluginbase surfacecontrollers in umbrac docs

    but not clear how to do it. so your advises will be great help

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Nov 01, 2023 @ 08:56
    Huw Reddick
    0

    I have copied dll to bin folder

    Where exactly did you copy it? There are subfolders under bin it needs to be in the correct one

  • Pathini 7 posts 77 karma points
    Nov 01, 2023 @ 09:20
    Pathini
    0

    hi Huw, I've copied it in PatU10Project\bin\Debug\net6.0\ then run command > dotnet run

    Do we need to change anything in configuration Startup.cs or Program.cs below is the complete error ,

    Building...
    Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'PatsSurfaceControllers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL'. The system cannot find the file specified.
    File name: 'PatsSurfaceControllers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL'
       at System.Reflection.RuntimeAssembly.InternalLoad(ObjectHandleOnStack assemblyName, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, Boolean throwOnFileNotFound, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack retAssembly)
       at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, RuntimeAssembly requestingAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, AssemblyLoadContext assemblyLoadContext)
       at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
       at Umbraco.Cms.Core.Composing.ReferenceResolver.ResolveAssemblies()
       at Umbraco.Cms.Core.Composing.FindAssembliesWithReferencesTo.Find()
       at Umbraco.Cms.Core.Composing.DefaultUmbracoAssemblyProvider.get_Assemblies()
       at Umbraco.Cms.Core.Composing.TypeFinder.GetAllAssemblies()
       at Umbraco.Cms.Core.Composing.TypeFinder.GetFilteredAssemblies(IEnumerable`1 excludeFromResults, String[] exclusionFilter)
       at Umbraco.Cms.Core.Composing.TypeFinder.get_AssembliesToScan()
       at Umbraco.Cms.Core.Composing.TypeLoader.get_AssembliesToScan()
       at Umbraco.Cms.Core.Composing.TypeLoader.<>c__DisplayClass21_0`1.<GetTypes>b__0()
       at Umbraco.Cms.Core.Composing.TypeLoader.GetTypesInternalLocked(Type baseType, Type attributeType, Func`1 finder, String action, Boolean cache)
       at Umbraco.Cms.Core.Composing.TypeLoader.GetTypesInternal(Type baseType, Type attributeType, Func`1 finder, String action, Boolean cache)
       at Umbraco.Cms.Core.Composing.TypeLoader.GetTypes[T](Boolean cache, IEnumerable`1 specificAssemblies)
       at Umbraco.Cms.Core.DependencyInjection.UmbracoBuilderExtensions.AddAllCoreCollectionBuilders(IUmbracoBuilder builder)
       at Umbraco.Cms.Core.DependencyInjection.UmbracoBuilder.AddCoreServices()
       at Umbraco.Cms.Core.DependencyInjection.UmbracoBuilder..ctor(IServiceCollection services, IConfiguration config, TypeLoader typeLoader, ILoggerFactory loggerFactory, IProfiler profiler, AppCaches appCaches, IHostingEnvironment hostingEnvironment)
       at Umbraco.Extensions.UmbracoBuilderExtensions.AddUmbraco(IServiceCollection services, IWebHostEnvironment webHostEnvironment, IConfiguration config)
       at PatU10Project.Startup.ConfigureServices(IServiceCollection services) in C:\pathiniDocs\Umbraco Projects\PatU10Project\PatU10Project\Startup.cs:line 32
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
       at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass9_0.<Invoke>g__Startup|0(IServiceCollection serviceCollection)
       at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services)
       at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass8_0.<Build>b__0(IServiceCollection services)
       at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services, Object instance)
       at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass13_0.<UseStartup>b__0(HostBuilderContext context, IServiceCollection services)
       at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
       at Microsoft.Extensions.Hosting.HostBuilder.Build()
       at Umbraco.Cms.Web.Common.Hosting.UmbracoHostBuilderDecorator.Build()
       at PatU10Project.Program.Main(String[] args) in C:\pathiniDocs\Umbraco Projects\PatU10Project\PatU10Project\Program.cs:line 6
    
Please Sign in or register to post replies

Write your reply to:

Draft