hi
Are you using the Identity Server?
Yes we do.
Hey,
we need to perform sign-in in code and then generate an access token (JWT token) for that user, so we can send the token to our mobile app.
Currently we have an AuthenticationAppService which has a login method like this:
public class AuthenticationService : ApplicationService, IAuthenticationAppService
{
private readonly IdentityUserManager _userManager;
private readonly SignInManager<Volo.Abp.Identity.IdentityUser> _signInManager;
public AuthenticationService(
IdentityUserManager userManager,
SignInManager<Volo.Abp.Identity.IdentityUser> signInManager)
{
_userManager = userManager;
_signInManager = signInManager;
}
public async Task<LoginResult> LoginAsync(LoginInput input)
{
var user = await _userManager.FindByNameAsync(input.Username);
if (user == null)
{
return new LoginResult()
{
Success = false,
};
}
var result = await _signInManager.CheckPasswordSignInAsync(user, input.Password, false);
if (!result.Succeeded)
{
return new LoginResult()
{
Success = false,
};
}
// Generate access token.
var accessToken = ???;
return new LoginResult()
{
Success = true,
AccessToken = accessToken,
};
}
}
The sign-in works, but how can we retrieve or generate an access token. We have a tiered solution, so the identity server is in another project.
Thanks for the input!
Even if we fixed the issue with the configuration, we still have the issue with the dynamic proxies.
We also had the following weird issues when compiling the solution on the iMac:
/Users/admin/Git/Conzepta/Conzepta.iOS/MTOUCH: Error MT2101: Can't resolve the reference
'System.Collections.Generic.ICollection`1<System.Action`2<System.Type,Autofac.Builder.IRegistrationBuilder`3<System.Object,Autofac.Builder.ConcreteReflectionActivatorData,Autofac.Builder.SingleRegistrationStyle>>>
Autofac.Features.Scanning.ScanningActivatorData::get_ConfigurationActions()', referenced from the method
'Autofac.Builder.IRegistrationBuilder`3<TLimit,Autofac.Features.Scanning.ScanningActivatorData,TRegistrationStyle> Autofac.Extras.DynamicProxy.RegistrationExtensions::EnableClassInterceptors(Autofac.Builder.IRegistrationBuilder`3<TLimit,Autofac.Features.Scanning.ScanningActivatorData,TRegistrationStyle>,Castle.DynamicProxy.ProxyGenerationOptions,System.Type[])' in 'Autofac, Version=6.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da'. (MT2101) (Conzepta.iOS)
We managed to make it build later, but no idea how ...
So something is not really working with those Dynamic Proxies on Xamarin iOS.
DynamicProxy needs System.Reflection.Emit: "... any another .NET platform that supports .NET Standard 2.0+ and runtime type generation using System.Reflection.Emit ..." https://github.com/castleproject/Core/blob/master/docs/dynamicproxy-introduction.md
System.Reflection.Emit not available for Xamarin.iOS: "The System.Reflection.Emit is not available. " https://docs.microsoft.com/en-us/xamarin/ios/internals/limitations#no-dynamic-code-generation
All in all, it is not possible to use the dynamic proxies on iOS. We will probably create the HttpClient ourself or use libraries like Refit for communicating with the backend.
So it seems PhysicalFilesWatcher is not supported on Xamarin-iOS (or at least in our version). We do not need it anyway, so how can we turn this feature off?
We tried finding any resources on how to turn it off, but we did not find anything.
We tried to find a way to turn it off on the AbpApplicationCreationOptions options. But couldn't find anything.
Can you point us to a documentation page or sample project?
Hey,
we have problems when running a module inside Xamarin-Forms on iOS.
We have the following code:
var application = AbpApplicationFactory.Create<Module>(options => // this line throws the exception
{
options.UseAutofac();
});
application.Initialize();
We receive the following exception:
System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed () [0x00019] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs:664
at System.IO.FileSystemWatcher.set_EnableRaisingEvents (System.Boolean value) [0x0001d] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs:163
at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.TryEnableFileSystemWatcher () [0x00040] in <bc6401a219974725bf7a82de6ab30543>:0
at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken (System.String filter) [0x00034] in <bc6401a219974725bf7a82de6ab30543>:0
at Microsoft.Extensions.FileProviders.PhysicalFileProvider.Watch (System.String filter) [0x00024] in <bc6401a219974725bf7a82de6ab30543>:0
at Microsoft.Extensions.Configuration.FileConfigurationProvider.<.ctor>b__1_0 () [0x00016] in <3cfa5edff95b45d581cfb833a66bda1f>:0
at Microsoft.Extensions.Primitives.ChangeToken+ChangeTokenRegistration`1[TState]..ctor (System.Func`1[TResult] changeTokenProducer, System.Action`1[T] changeTokenConsumer, System.Action state) [0x0001b] in <a17448b39538493dabfebe0c018d8c10>:0
at Microsoft.Extensions.Primitives.ChangeToken.OnChange (System.Func`1[TResult] changeTokenProducer, System.Action changeTokenConsumer) [0x0001c] in <a17448b39538493dabfebe0c018d8c10>:0
at Microsoft.Extensions.Configuration.FileConfigurationProvider..ctor (Microsoft.Extensions.Configuration.FileConfigurationSource source) [0x00036] in <3cfa5edff95b45d581cfb833a66bda1f>:0
at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider..ctor (Microsoft.Extensions.Configuration.Json.JsonConfigurationSource source) [0x00000] in <13320dc1bda7441691d3d3ee4b6465b7>:0
at Microsoft.Extensions.Configuration.Json.JsonConfigurationSource.Build (Microsoft.Extensions.Configuration.IConfigurationBuilder builder) [0x00007] in <13320dc1bda7441691d3d3ee4b6465b7>:0
at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build () [0x0001b] in <3b2c752b86514c138e527d40dea12e05>:0
at Microsoft.Extensions.Configuration.ConfigurationHelper.BuildConfiguration (Microsoft.Extensions.Configuration.AbpConfigurationBuilderOptions options, System.Action`1[T] builderAction) [0x000ee] in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Core\Microsoft\Extensions\Configuration\ConfigurationHelper.cs:49
at Volo.Abp.Internal.InternalServiceCollectionExtensions.AddCoreAbpServices (Microsoft.Extensions.DependencyInjection.IServiceCollection services, Volo.Abp.IAbpApplication abpApplication, Volo.Abp.AbpApplicationCreationOptions applicationCreationOptions) [0x0001c] in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Core\Volo\Abp\Internal\InternalServiceCollectionExtensions.cs:30
at Volo.Abp.AbpApplicationBase..ctor (System.Type startupModuleType, Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action`1[T] optionsAction) [0x0005a] in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Core\Volo\Abp\AbpApplicationBase.cs:49
at Volo.Abp.AbpApplicationWithInternalServiceProvider..ctor (System.Type startupModuleType, Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action`1[T] optionsAction) [0x00000] in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Core\Volo\Abp\AbpApplicationWithInternalServiceProvider.cs:27
at Volo.Abp.AbpApplicationWithInternalServiceProvider..ctor (System.Type startupModuleType, System.Action`1[T] optionsAction) [0x00000] in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Core\Volo\Abp\AbpApplicationWithInternalServiceProvider.cs:15
at Volo.Abp.AbpApplicationFactory.Create (System.Type startupModuleType, System.Action`1[T] optionsAction) [0x00000] in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Core\Volo\Abp\AbpApplicationFactory.cs:76
at Volo.Abp.AbpApplicationFactory.Create[TStartupModule] (System.Action`1[T] optionsAction) [0x00000] in <73e55470c3b14481b288376a3bdad510>:0
at App.ApplicationCreator.Create () [0x00001] in /Users/admin/Git/App/App/AbpCommercial/ApplicationCreator.cs:9
...
/Users/admin/Git/App/App/Main.cs:9
We know that System.Reflection.Emit is not supported on iOS. How can we make this work? We need the Dynamic Proxy Feature of ABP to call app services remotely.
Thanks!
Ok I found out that I had different versions for ABP Libraries and ABP Suite.
ABP Libraries were on 5.1.4 and ABP Suite was on version 5.1.3. Updating ABP Suite to 5.1.4 fixed the problem.
Thanks for the AutoMapper code, yes this change was necessary for the Blazor app to work properly.
Hey,
we are trying to add the Account module as source code to our project, but we get this error:
System.Exception: Build failed!
at Volo.Abp.Cli.Build.DefaultDotNetProjectBuilder.BuildInternal(DotNetProjectInfo project, String arguments, ConcurrentBag`1 builtProjects) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Build\DefaultDotNetProjectBuilder.cs:line 92
at Volo.Abp.Cli.Build.DefaultDotNetProjectBuilder.BuildProjects(List`1 projects, String arguments) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Build\DefaultDotNetProjectBuilder.cs:line 41
[14:01:31 ERR] Error occured while adding the module Volo.Account.Prowith source-code to the solution "0e3bb534-5f90-44ca-9b73-24b9c976a316".. System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Could not load file or assembly 'Volo.Abp.Core, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'. Could not find or load a specific file. (0x80131621)
Could not load file or assembly 'Volo.Abp.UI, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'. Could not find or load a specific file. (0x80131621)
Could not load file or assembly 'Volo.Abp.Core, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'. Could not find or load a specific file. (0x80131621)
Could not load file or assembly 'Volo.Abp.UI.Navigation, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'. Could not find or load a specific file. (0x80131621)
Could not load file or assembly 'Volo.Abp.Core, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'. Could not find or load a specific file. (0x80131621)
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Volo.Abp.Cli.Bundling.BundlingService.GetStartupModule(String assemblyPath) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Bundling\BundlingService.cs:line 277
at Volo.Abp.Cli.Bundling.BundlingService.BundleAsync(String directory, Boolean forceBuild) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Bundling\BundlingService.cs:line 61
at Volo.Abp.Cli.Commands.BundleCommand.ExecuteAsync(CommandLineArgs commandLineArgs) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Commands\BundleCommand.cs:line 45
at Volo.Abp.Cli.ProjectModification.SolutionModuleAdder.RunBundleForBlazorAsync(String[] projectFiles, ModuleWithMastersInfo module) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectModification\SolutionModuleAdder.cs:line 203
at Volo.Abp.Cli.ProjectModification.SolutionModuleAdder.AddAsync(String solutionFile, String moduleName, String version, Boolean skipDbMigrations, Boolean withSourceCode, Boolean addSourceCodeToSolutionFile, Boolean newTemplate, Boolean newProTemplate) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectModification\SolutionModuleAdder.cs:line 134
at Volo.Abp.Cli.Commands.AddModuleCommand.ExecuteAsync(CommandLineArgs commandLineArgs) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Commands\AddModuleCommand.cs:line 68
at Volo.Abp.Suite.Controllers.AbpSuiteController.AddModuleAsync(AddModuleInput input)
System.IO.FileLoadException: Could not load file or assembly 'Volo.Abp.Core, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'. Could not find or load a specific file. (0x80131621)
File name: 'Volo.Abp.Core, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'
---> System.IO.FileLoadException: Could not load file or assembly 'Volo.Abp.Core, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'.
at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at System.Reflection.Assembly.LoadFromResolveHandler(Object sender, ResolveEventArgs args)
at System.Runtime.Loader.AssemblyLoadContext.InvokeResolveEvent(ResolveEventHandler eventHandler, RuntimeAssembly assembly, String name)
at System.Runtime.Loader.AssemblyLoadContext.OnAssemblyResolve(RuntimeAssembly assembly, String assemblyFullName)
System.IO.FileLoadException: Could not load file or assembly 'Volo.Abp.UI, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'. Could not find or load a specific file. (0x80131621)
File name: 'Volo.Abp.UI, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'
---> System.IO.FileLoadException: Could not load file or assembly 'Volo.Abp.UI, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'.
at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at System.Reflection.Assembly.LoadFromResolveHandler(Object sender, ResolveEventArgs args)
at System.Runtime.Loader.AssemblyLoadContext.InvokeResolveEvent(ResolveEventHandler eventHandler, RuntimeAssembly assembly, String name)
at System.Runtime.Loader.AssemblyLoadContext.OnAssemblyResolve(RuntimeAssembly assembly, String assemblyFullName)
System.IO.FileLoadException: Could not load file or assembly 'Volo.Abp.Core, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'. Could not find or load a specific file. (0x80131621)
File name: 'Volo.Abp.Core, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'
---> System.IO.FileLoadException: Could not load file or assembly 'Volo.Abp.Core, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'.
at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at System.Reflection.Assembly.LoadFromResolveHandler(Object sender, ResolveEventArgs args)
at System.Runtime.Loader.AssemblyLoadContext.InvokeResolveEvent(ResolveEventHandler eventHandler, RuntimeAssembly assembly, String name)
at System.Runtime.Loader.AssemblyLoadContext.OnAssemblyResolve(RuntimeAssembly assembly, String assemblyFullName)
System.IO.FileLoadException: Could not load file or assembly 'Volo.Abp.UI.Navigation, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'. Could not find or load a specific file. (0x80131621)
File name: 'Volo.Abp.UI.Navigation, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'
---> System.IO.FileLoadException: Could not load file or assembly 'Volo.Abp.UI.Navigation, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'.
at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at System.Reflection.Assembly.LoadFromResolveHandler(Object sender, ResolveEventArgs args)
at System.Runtime.Loader.AssemblyLoadContext.InvokeResolveEvent(ResolveEventHandler eventHandler, RuntimeAssembly assembly, String name)
at System.Runtime.Loader.AssemblyLoadContext.OnAssemblyResolve(RuntimeAssembly assembly, String assemblyFullName)
System.IO.FileLoadException: Could not load file or assembly 'Volo.Abp.Core, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'. Could not find or load a specific file. (0x80131621)
File name: 'Volo.Abp.Core, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'
---> System.IO.FileLoadException: Could not load file or assembly 'Volo.Abp.Core, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'.
at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at System.Reflection.Assembly.LoadFromResolveHandler(Object sender, ResolveEventArgs args)
at System.Runtime.Loader.AssemblyLoadContext.InvokeResolveEvent(ResolveEventHandler eventHandler, RuntimeAssembly assembly, String name)
at System.Runtime.Loader.AssemblyLoadContext.OnAssemblyResolve(RuntimeAssembly assembly, String assemblyFullName)
The reason is this:
C:\Program Files\dotnet\sdk\6.0.200\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(363,5): warning MSB3026: Could not copy "obj\Debug\net6.0\Acme.Blazor.dll" to "D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework/Acme.Blazor.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework\Acme.Blazor.dll' because it is being used by another process. [D:\NET\Acme\src\Acme.Blazor\Acme.Blazor.csproj]
C:\Program Files\dotnet\sdk\6.0.200\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(363,5): warning MSB3026: Could not copy "obj\Debug\net6.0\Acme.Blazor.dll" to "D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework/Acme.Blazor.dll". Beginning retry 2 in 1000ms. The process cannot access the file 'D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework\Acme.Blazor.dll' because it is being used by another process. [D:\NET\Acme\src\Acme.Blazor\Acme.Blazor.csproj]
C:\Program Files\dotnet\sdk\6.0.200\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(363,5): warning MSB3026: Could not copy "obj\Debug\net6.0\Acme.Blazor.dll" to "D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework/Acme.Blazor.dll". Beginning retry 3 in 1000ms. The process cannot access the file 'D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework\Acme.Blazor.dll' because it is being used by another process. [D:\NET\Acme\src\Acme.Blazor\Acme.Blazor.csproj]
C:\Program Files\dotnet\sdk\6.0.200\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(363,5): warning MSB3026: Could not copy "obj\Debug\net6.0\Acme.Blazor.dll" to "D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework/Acme.Blazor.dll". Beginning retry 4 in 1000ms. The process cannot access the file 'D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework\Acme.Blazor.dll' because it is being used by another process. [D:\NET\Acme\src\Acme.Blazor\Acme.Blazor.csproj]
C:\Program Files\dotnet\sdk\6.0.200\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(363,5): warning MSB3026: Could not copy "obj\Debug\net6.0\Acme.Blazor.dll" to "D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework/Acme.Blazor.dll". Beginning retry 5 in 1000ms. The process cannot access the file 'D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework\Acme.Blazor.dll' because it is being used by another process. [D:\NET\Acme\src\Acme.Blazor\Acme.Blazor.csproj]
C:\Program Files\dotnet\sdk\6.0.200\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(363,5): warning MSB3026: Could not copy "obj\Debug\net6.0\Acme.Blazor.dll" to "D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework/Acme.Blazor.dll". Beginning retry 6 in 1000ms. The process cannot access the file 'D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework\Acme.Blazor.dll' because it is being used by another process. [D:\NET\Acme\src\Acme.Blazor\Acme.Blazor.csproj]
C:\Program Files\dotnet\sdk\6.0.200\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(363,5): warning MSB3026: Could not copy "obj\Debug\net6.0\Acme.Blazor.dll" to "D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework/Acme.Blazor.dll". Beginning retry 7 in 1000ms. The process cannot access the file 'D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework\Acme.Blazor.dll' because it is being used by another process. [D:\NET\Acme\src\Acme.Blazor\Acme.Blazor.csproj]
C:\Program Files\dotnet\sdk\6.0.200\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(363,5): warning MSB3026: Could not copy "obj\Debug\net6.0\Acme.Blazor.dll" to "D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework/Acme.Blazor.dll". Beginning retry 8 in 1000ms. The process cannot access the file 'D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework\Acme.Blazor.dll' because it is being used by another process. [D:\NET\Acme\src\Acme.Blazor\Acme.Blazor.csproj]
C:\Program Files\dotnet\sdk\6.0.200\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(363,5): warning MSB3026: Could not copy "obj\Debug\net6.0\Acme.Blazor.dll" to "D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework/Acme.Blazor.dll". Beginning retry 9 in 1000ms. The process cannot access the file 'D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework\Acme.Blazor.dll' because it is being used by another process. [D:\NET\Acme\src\Acme.Blazor\Acme.Blazor.csproj]
C:\Program Files\dotnet\sdk\6.0.200\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(363,5): warning MSB3026: Could not copy "obj\Debug\net6.0\Acme.Blazor.dll" to "D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework/Acme.Blazor.dll". Beginning retry 10 in 1000ms. The process cannot access the file 'D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework\Acme.Blazor.dll' because it is being used by another process. [D:\NET\Acme\src\Acme.Blazor\Acme.Blazor.csproj]
C:\Program Files\dotnet\sdk\6.0.200\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(363,5): error MSB3027: Could not copy "obj\Debug\net6.0\Acme.Blazor.dll" to "D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework/Acme.Blazor.dll". Exceeded retry count of 10. Failed. [D:\NET\Acme\src\Acme.Blazor\Acme.Blazor.csproj]
C:\Program Files\dotnet\sdk\6.0.200\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(363,5): error MSB3021: Unable to copy file "obj\Debug\net6.0\Acme.Blazor.dll" to "D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework/Acme.Blazor.dll". The process cannot access the file 'D:\NET\Acme\src\Acme.Blazor\bin\Debug\net6.0\wwwroot\_framework\Acme.Blazor.dll' because it is being used by another process. [D:\NET\Acme\src\Acme.Blazor\Acme.Blazor.csproj]
It seems some files can not be copied.We made sure VisualStudio is not running. We even tried restarting the PC and creating a fresh new ABP Commercial Application. But we get the same issue.
Do you have any suggestions to solve this problem?
3rd Party clients such as android are out of the box right now. I can't suggest the best way to use with ABP together but, I can recommend using ngrok for testing at development time.
It seems your last exception occurs at https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ClientProxyBase.cs#L36
So, it shows LazyServiceProvider is null. Most probably Autofac couldn't be configured properly.
Thanks for pointing us in the right direction of the issue.
We found and solved our problem regarding Autofac:
var application = AbpApplicationFactory.Create<Module>(options =>
{
options.UseAutofac(); // This line was missing.
});
application.Initialize();
return application;
We thought including the Autofac module in the DependsOn attribute would automatically add and use Autofac. But this seems not to be the case.
We also tried the following code in the module:
public override void PreConfigureServices(ServiceConfigurationContext context)
{
context.Services.PreConfigure<AbpHttpClientBuilderOptions>(options =>
{
options.ProxyClientBuildActions.Add((s, b) =>
{
b.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler
{
ClientCertificateOptions = ClientCertificateOption.Manual,
ServerCertificateCustomValidationCallback = (x, x1, x2, x3) => true,
});
});
});
}
The ServerCertificateCustomValidationCallback is called, but we then receive the following exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1[TService].get_ClientOptions () [0x00000] in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Http.Client\Volo\Abp\Http\Client\ClientProxying\ClientProxyBase.cs:36
at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1[TService].RequestAsync (Volo.Abp.Http.Client.ClientProxying.ClientProxyRequestContext requestContext) [0x00030] in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Http.Client\Volo\Abp\Http\Client\ClientProxying\ClientProxyBase.cs:108
at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1[TService].RequestAsync[T] (Volo.Abp.Http.Client.ClientProxying.ClientProxyRequestContext requestContext) [0x0003d] in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Http.Client\Volo\Abp\Http\Client\ClientProxying\ClientProxyBase.cs:76
at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptorClientProxy`1[TService].CallRequestAsync[T] (Volo.Abp.Http.Client.ClientProxying.ClientProxyRequestContext requestContext) [0x0002d] in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Http.Client\Volo\Abp\Http\Client\DynamicProxying\DynamicHttpProxyInterceptorClientProxy.cs:11
at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor`1[TService].CallRequestAsync[T] (Volo.Abp.Http.Client.ClientProxying.ClientProxyRequestContext context) [0x00032] in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Http.Client\Volo\Abp\Http\Client\DynamicProxying\DynamicHttpProxyInterceptor.cs:92
at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor`1[TService].GetResultAsync (System.Threading.Tasks.Task task, System.Type resultType) [0x0001f] in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Http.Client\Volo\Abp\Http\Client\DynamicProxying\DynamicHttpProxyInterceptor.cs:97
at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor`1[TService].InterceptAsync (Volo.Abp.DynamicProxy.IAbpMethodInvocation invocation) [0x001a2] in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Http.Client\Volo\Abp\Http\Client\DynamicProxying\DynamicHttpProxyInterceptor.cs:71
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1[TInterceptor].InterceptAsync[TResult] (Castle.DynamicProxy.IInvocation invocation, Castle.DynamicProxy.IInvocationProceedInfo proceedInfo, System.Func`3[T1,T2,TResult] proceed) [0x00059] in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Castle.Core\Volo\Abp\Castle\DynamicProxy\CastleAsyncAbpInterceptorAdapter.cs:29
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult] (Castle.DynamicProxy.IInvocation invocation, Castle.DynamicProxy.IInvocationProceedInfo proceedInfo) [0x00079] in <25225aa189ef4d0091cfe671f9159d35>:0
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1[TResult].ProceedAsync () [0x00038] in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Castle.Core\Volo\Abp\Castle\DynamicProxy\CastleAbpMethodInvocationAdapterWithReturnValue.cs:24
at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync (Volo.Abp.DynamicProxy.IAbpMethodInvocation invocation) [0x0009c] in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Validation\Volo\Abp\Validation\ValidationInterceptor.cs:19
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1[TInterceptor].InterceptAsync[TResult] (Castle.DynamicProxy.IInvocation invocation, Castle.DynamicProxy.IInvocationProceedInfo proceedInfo, System.Func`3[T1,T2,TResult] proceed) [0x00059] in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Castle.Core\Volo\Abp\Castle\DynamicProxy\CastleAsyncAbpInterceptorAdapter.cs:29
at Conzepta.Lotus.Mobile.Client.Features.Scanner.Controller.FinishedNavigationAsync (System.Object[] parameters) [0x001bd] in D:\.net\Conzepta.Lotus.Mobile.Client\Conzepta.Lotus.Mobile.Client\Features\Scanner\Controller.cs:51 }
Is there maybe a way to override the DefaultDynamicProxyHttpClientFactory factory and return our own HttpClient? We already got the connection working with our own HttpClient.