0

Here BiginCollectionItemCore (v-1.1.0) used in .net core 6 application.

this assembly called by @using HtmlHelpers.BeginCollectionItemCore

@using HtmlHelpers.BeginCollectionItemCore
@using (Html.BeginCollectionItem("GiftCardInfos"))
{
<td>
    <input type="hidden" asp-for="Id">
    <input type="hidden" asp-for="GCNumber">
    <input type="hidden" asp-for="ActiveStatus" class="ActiveStatus">
    @Model.GCNumber
</td>
<td>
    <input type="hidden" asp-for="BuyingPrice">
    @Model.BuyingPrice
</td>
<td>
    <input type="hidden" asp-for="Quantity">
    @Model.Quantity
</td>
    <td>
        <input type="hidden" asp-for="AcquiredPrice">
        @Model.AcquiredPrice
    </td>
}

Now after publish .net core application and implement to my local machine iis. this assembly works fine. I also deployed the published application to multiple machines. which run on windows 10 and windows server both. Now my current problem is that one machine could not find above assembly and throws exception.

Application: w3wp.exe
CoreCLR Version: 6.0.1623.17311
.NET Version: 6.0.16
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException: Could not load file or assembly 'BeginCollectionItemCore, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'BeginCollectionItemCore, Culture=neutral, PublicKeyToken=null'
   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(String assemblyString)
   at Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.<>c.<GetApplicationPartAssemblies>b__8_0(ApplicationPartAttribute name)
   at System.Linq.Enumerable.SelectArrayIterator`2.ToArray()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.GetEnumerator()+MoveNext()
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Linq.Enumerable.ConcatIterator`1.MoveNext()
   at Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.PopulateDefaultParts(String entryAssemblyName)
   at Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.GetApplicationPartManager(IServiceCollection services, IWebHostEnvironment environment)
   at Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.AddMvcCore(IServiceCollection services)
   at Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddControllersCore(IServiceCollection services)
   at Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddControllersWithViewsCore(IServiceCollection services)
   at Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddControllersWithViews(IServiceCollection services)
   at Program.<Main>$(String[] args) in D:\...\Program.cs:line 22

in program.cs line 22 is not the error area.

// line 22
// Add services to the container.
builder.Services.AddControllersWithViews(); 

I assume this is iis or windows problem. Please help regarding this issue. I am user dotnet-hosting-6.0.16-win.exe to run on other machine. and i checked iis version and iis settings.

Mohammed Sabbir
  • 103
  • 1
  • 7
  • This error usually means that the assembly was not found. Try verifying that the file exists in the directory where your application is running. – Qing Guo Jun 02 '23 at 02:47
  • Finally, it occurred because the system did not have permission to access its folder. – Mohammed Sabbir Jul 05 '23 at 11:54

0 Answers0