error creating the route with name 'Nop.Plugin.Myplugin.Configure' and template 'Plugins/MyPluginl/Configure'

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hi,

I am experiencing problems in creating a simple Configure View.

Those are my components I added:

public class MyPlugin : BasePlugin, IMiscPlugin
    {       public override string GetConfigurationPageUrl()
        {

            return _webHelper.GetStoreLocation() + "Admin/ABCMyPlugin/Configure";
        }

######################################

public class ConfigurationModel : BaseNopModel
    {
//empty right now
}

#########################################

@model Nop.Plugin.ABC.MyPlugin.Models.ConfigurationModel
@inject Nop.Core.IWebHelper webHelper
@{
    Layout = "_ConfigurePlugin";
}
<form asp-controller="WidgetsGoogleAnalytics" asp-action="Configure" method="post">
    <div class="panel-group">
        <div class="panel panel-default">
            <div class="panel-body">
                <h1> Mail Absender </h1>
            </div>
        </div>
    </div>
</form>



#########################################

Views/
---_ViewImports.cshtml
---Configure.cshtml


############

What am I missing???

Also I realized that despite my settings a subfolder net461 is created in
nop.web/plugins/abc.myPlugin/net461
and assemblies and files of the plugin are placed beneath.
6 years ago
apfelsine wrote:

Also I realized that despite my settings a subfolder net461 is created in
nop.web/plugins/abc.myPlugin/net461
and assemblies and files of the plugin are placed beneath.


You can remove net461 from out path at plugin library project property
6 years ago
I DID remove it, but it is applied automatically by Visual Studio! Even if I remove it, the minute I save it gets reentered again.
6 years ago
apfelsine wrote:
I DID remove it, but it is applied automatically by Visual Studio! Even if I remove it, the minute I save it gets reentered again.


That would be due the Copy Local setting of the reference property.
6 years ago
seanrock wrote:
I DID remove it, but it is applied automatically by Visual Studio! Even if I remove it, the minute I save it gets reentered again.

That would be due the Copy Local setting of the reference property.


Hi dear.
I don't understand.What's your purpose?
please describe more.
Thanks.
6 years ago
You need to set OutDir in your plugin.csproj file

Open plugin.csproj file and update Debug|AnyCPU' adn Release|AnyCPU' section.

There should be tag
<OutDir>$(OutputPath)</OutDir>
available.


Like

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <OutputPath>..\Presentation\Nop.Web\Plugins\plugin.Folder.Name\</OutputPath>
  <OutDir>$(OutputPath)</OutDir>
  </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">  
  <OutputPath>..\Presentation\Nop.Web\Plugins\plugin.Folder.Name\</OutputPath>  
   <OutDir>$(OutputPath)</OutDir>
  </PropertyGroup>
6 years ago
And also remove net461 from out path at plugin library project property
6 years ago
rajupaladiya wrote:
You need to set OutDir in your plugin.csproj file

Open plugin.csproj file and update Debug|AnyCPU' adn Release|AnyCPU' section.

There should be tag
<OutDir>$(OutputPath)</OutDir>
available.


Like

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <OutputPath>..\Presentation\Nop.Web\Plugins\plugin.Folder.Name\</OutputPath>
  <OutDir>$(OutputPath)</OutDir>
  </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">  
  <OutputPath>..\Presentation\Nop.Web\Plugins\plugin.Folder.Name\</OutputPath>  
   <OutDir>$(OutputPath)</OutDir>
  </PropertyGroup>


Thanks for your reply.
I do all these things. But can not worked.

my code in project.csproj:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net461</TargetFramework>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <OutputPath>..\..\Presentation\Nop.Web\Plugins\Misc.Sample\</OutputPath>
    <OutDir>$(OutputPath)</OutDir>
    <!--<DefineConstants>DEBUG;TRACE;NET461;RELEASE;NET461</DefineConstants>-->
    <!--<Optimize>true</Optimize>-->
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <!--<DefineConstants>TRACE;DEBUG;NET461;</DefineConstants>-->
    <!--<Optimize>true</Optimize>-->
    <OutputPath>..\..\Presentation\Nop.Web\Plugins\Misc.Sample\</OutputPath>
  </PropertyGroup>

<Target Name="NopTarget" AfterTargets="Build">
  <MSBuild Projects="$(MSBuildProjectDirectory)\..\..\Build\ClearPluginAssemblies.proj" Properties="PluginPath=$(MSBuildProjectDirectory)\$(OutDir)" Targets="NopClear" />
</Target>

<ItemGroup>
  <None Remove="logo.jpg" />
</ItemGroup>

  <ItemGroup>
  <Content Include="logo.jpg">
    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  </Content>
  <Content Include="plugin.json">
    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  </Content>
  <Content Include="Views\CustomHomeAdmin\CustomIndex.cshtml">
    <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  </Content>
  <Content Include="Views\_ViewImports.cshtml">
    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  </Content>
</ItemGroup>

<ItemGroup>
  <ProjectReference Include="..\..\Libraries\Nop.Core\Nop.Core.csproj" />
  <ProjectReference Include="..\..\Libraries\Nop.Services\Nop.Services.csproj" />
  <ProjectReference Include="..\..\Presentation\Nop.Web.Framework\Nop.Web.Framework.csproj" />
  <ProjectReference Include="..\..\Presentation\Nop.Web\Nop.Web.csproj" />
</ItemGroup>

<ItemGroup>
  <Folder Include="Factories\" />
</ItemGroup>

<ItemGroup>
  <Reference Include="MD.PersianDateTime">
    <HintPath>bin\Debug\MD.PersianDateTime.dll</HintPath>
    <Private>true</Private>
  </Reference>
  <Reference Include="Persia">
    <HintPath>bin\Debug\Persia.dll</HintPath>
    <Private>true</Private>
  </Reference>
  <Reference Include="PersianDate">
    <HintPath>bin\Debug\PersianDate.dll</HintPath>
    <Private>true</Private>
  </Reference>
</ItemGroup>
</Project>



Thanks
6 years ago
EDIT: well I know now that I lack 1 line maybe that does the trick.
6 years ago
apfelsine wrote:
EDIT: well I know now that I lack 1 line maybe that does the trick.



I did not notice.
Please explain more?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.