Quantcast
Channel: Off-Topic Posts (Do Not Post Here) forum
Viewing all 13882 articles
Browse latest View live

Jobs inside job ~ PowerShell

$
0
0

I wrote a script where I want to break one file into small parts and process all small parts same time to get better performance. I am using for loop inside a job and creating child jobs from there. While executing the script sometimes all small parts are processing fine. Sometimes 2 of them processing for same source. Any idea why this is happening?

*************************************************************************************************

Script 1: Master.ps1

Start-Job -filepath "sc_8200.ps1"

*************************************************************************************************

Script 2: sc_8200.ps1

$files = Get-ChildItem "\Desktop\sc" -Filter "splitlog*" | Select-Object -Expand fullname
foreach($file in $files)
{
Start-Job -Name $file -filepath "\Desktop\sc\sc_8200_child.ps1" -ArgumentList $file
}

*************************************************************************************************

Note: "splitlog" is name of small files.

*************************************************************************************************

Script 3: sc_8200_child.ps1

param (
    [string]$path
 )
Function Test()
{
$contents = Get-Content $path
foreach($content in $contents)
{
$temp = $path.SubString(0,$path.Length-4)
$outputfile = $temp+"_O.txt"
Get-ChildItem $content -Recurse -include *.* | Select-Object -Expand fullname >> $outputfile
}
}

Test

*************************************************************************************************


UseNativePageFooter in C# code

$
0
0

Hi All,

When we render the SSRS report in Excel , Because of the default settings of the Footer properties Footer section will be divided into 3 sections which is causing issues when we have to display the data.

Please check this thread for more details :

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/dc3f7286-4dbc-4c69-a0b7-5344c21719b4/ssrs-export-to-excel-is-not-exporting-all-the-fields-in-the-footer?forum=sqlreportingservices

I read some where that if we set this property(UseNativePageFooter = False) in the code will resolve the issue but I could not able to find any helpful information about where exactly we can define this.

(Please note I am not a .net developer but I am trying to gather the information to share with my dev team so that they can help me in fixing the issue)


Hope someone will be able to guide me in the right direction.

Thanks,

Sam

Achieve SSO using Identity Server 3 in MVC

$
0
0

I have set up an identity server 3 in my app. Following is the code:

public void ConfigureAuth(IAppBuilder app)
    {
        // Configure Identity Server
        // at the identity uri, you are going to find the identity server
        app.Map("/identity", idsrvApp =>
        {
            idsrvApp.UseIdentityServer(new IdentityServerOptions
            {
                SiteName = "Embedded identity server",
                //IssuerUri = "https://identitysrv3/embedded", // in real scenarios  make sure this is unique. to uniquely identify users

                Factory = new IdentityServerServiceFactory()
                .UseInMemoryClients(Clients.Get())
                .UseInMemoryScopes(Scopes.Get())
                .UseInMemoryUsers(User.Get()),

                // this is not for SSL, that will be provided by IIS or Azure where we deploy. This is to sign the tokens
                SigningCertificate = LoadCertificate()
            });
        });        

        X509Certificate2 LoadCertificate()
        {
            return new X509Certificate2(
        string.Format(@"{0}\bin\identityServer\idsrv3test.pfx", AppDomain.CurrentDomain.BaseDirectory), "idsrv3test");
        }
    }

With this for now I am using inmemory users. Do I have to implement ASP.NET identity to achieve SSO?.

This is my User class:

public static List<InMemoryUser> Get()
    {
        return new List<InMemoryUser>()
        {
            new InMemoryUser
            {
                Username = "Sidd",
                Password = "secret",
                Subject = "1",

                Claims = new[]
                {
                    new Claim(Constants.ClaimTypes.GivenName, "Sidd"),
                    new Claim(Constants.ClaimTypes.FamilyName, "Mehta"),
                }
            },
            new InMemoryUser
            {
                Username = "Humpty",
                Password = "secret",
                Subject = "3",

                Claims = new[]
                {
                    new Claim(Constants.ClaimTypes.GivenName, "Humpty"),
                    new Claim(Constants.ClaimTypes.FamilyName, "Sharma"),
                }
            },
            new InMemoryUser
            {
                Username = "Virat",
                Password = "secret",
                Subject = "4",

                Claims = new[]
                {
                    new Claim(Constants.ClaimTypes.GivenName, "Virat"),
                    new Claim(Constants.ClaimTypes.FamilyName, "Kohli"),
                }
            }
        };
    }

and this is my Clients class:
public static IEnumerable<Client> Get()
    {
        return new[]
        {
            new Client
            {
                Enabled = true,
                ClientName = "Identity Server Web Access",
                ClientId = "mvc",
                Flow = Flows.Hybrid,
                //RequireConsent = true,

                RedirectUris=new List<string>
                {
                    //"https://localhost:44329/"
                    AppConstants.IdClient,
                    AppConstants.IdClient2
                },
                AllowedScopes = new List<string>
                {"openid","profile",                        
                }
            }
        };
    }

The redirect uri's contains the MVC client application URLs.

With the identity and users already set, I make my MVC application client. Both the configurations of the application are similar. Following is the code:

Web Client 2:

public void Configuration(IAppBuilder app)
    {
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=316888

        app.UseCookieAuthentication(new Microsoft.Owin.Security.Cookies.CookieAuthenticationOptions
        {
            AuthenticationType = "Cookies"
        });

        app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
        {
            ClientId = "mvc",
            Authority = AppConstants.IdSrv,
            RedirectUri = AppConstants.IdClient2,
            SignInAsAuthenticationType = "Cookies",
            ResponseType = "code id_token",
            Scope = "openid",

            Notifications = new OpenIdConnectAuthenticationNotifications()
            {
                MessageReceived = async n =>
                {
                    EndpointAndTokenHelper.DecodeAndWrite(n.ProtocolMessage.IdToken);
                }

            }
        });
    }

Web Client 1:
public void Configuration(IAppBuilder app)
    {
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=316888

        JwtSecurityTokenHandler.DefaultInboundClaimTypeMap = new Dictionary<string, string>();

        AntiForgeryConfig.UniqueClaimTypeIdentifier = "unique_user_key";

        app.UseCookieAuthentication(new Microsoft.Owin.Security.Cookies.CookieAuthenticationOptions
        {
            AuthenticationType="Cookies"
        });

        app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
        {
            ClientId = "mvc",
            Authority = AppConstants.IdSrv,
            RedirectUri = AppConstants.IdClient,
            SignInAsAuthenticationType = "Cookies",
            ResponseType = "code id_token token",
            Scope = "openid profile",

            Notifications = new OpenIdConnectAuthenticationNotifications()
            {
                MessageReceived = async n =>
                {
                    //EndpointAndTokenHelper.DecodeAndWrite(n.ProtocolMessage.IdToken);
                    //EndpointAndTokenHelper.DecodeAndWrite(n.ProtocolMessage.AccessToken);

                    //var userinfo = await EndpointAndTokenHelper.CallUserInfoEndpoint(n.ProtocolMessage.AccessToken);
                },

                SecurityTokenValidated=async n =>
                {
                    var userInfo = await EndpointAndTokenHelper.CallUserInfoEndpoint(n.ProtocolMessage.AccessToken);

                    var givenNameClaim = new Claim(
                        Thinktecture.IdentityModel.Client.JwtClaimTypes.GivenName,
                        userInfo.Value<string>("given_name"));

                    var familyNameClaim = new Claim(
                        Thinktecture.IdentityModel.Client.JwtClaimTypes.FamilyName,
                        userInfo.Value<string>("family_name"));

                    //var roles = userInfo.Value<JArray>("role").ToList();

                    var newIdentity = new ClaimsIdentity(
                       n.AuthenticationTicket.Identity.AuthenticationType,
                       Thinktecture.IdentityModel.Client.JwtClaimTypes.GivenName,
                       Thinktecture.IdentityModel.Client.JwtClaimTypes.Role);

                    newIdentity.AddClaim(givenNameClaim);
                    newIdentity.AddClaim(familyNameClaim);
                }


            }
        });            
    }

want to know what more settings need to be done in order to achieve SSO?. I am able to hit the identity server, input my user credentials, have my redirect uri's in place. When I log to both websites it asks me for user credentials when calling on the [Authorize] attribute in my home controller.

Any help on how to achieve SSO using above code I have would be great. Currently I am running on a localhost, but I would be putting both websites under one domain only.

Its very urgent and I need to prepare a demo, so any help quickly would be great.

Thanks in advance!

How to keep only the matched node structs when searching in AdvTree list?

$
0
0

I have AdvTree control and the tree list is multi-level struct, now I need to build the search function to loop through all nodes using the recursive function, hide the nodes that not matched searched value. But how to only keep the matched tree list? The code is below.

Private Sub FilterAllNodes(ByVal objNC As NodeCollection, ByVal ComparedString As String)
        Dim nodeMatched As Boolean
        For Each node As Node In objNC
            If node.HasChildNodes = False Then
                If Node.text=ComparedString Then       
                    nodeMatched = True
                 End If          
                node.Visible = nodeMatched
            Else
                FilterAllNodes(node.Nodes, ComparedString)
            End If
        Next
    End Sub

View the image below, only remain the red region.


Error which I don't know how to fix

$
0
0
I get this error when I try to build for Android Emulator. It worked fine but after downloading some source code from Microsoft and building it something happened.

Please help thank you.

Here are the errors: Severity    Code    Description    Project    File    Line    Suppression State    Suppression State
Error        ADB0010: Unexpected install output: cmd: Can't find service: package

   at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) in E:\A\_work\101\s\External\androidtools\Mono.AndroidTools\Internal\AdbOutputParsing.cs:line 345
   at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass95_0.<InstallPackage>b__0(Task`1 t) in E:\A\_work\101\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 753
   at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()             0        


---------------------------------------------------------------------


Severity    Code    Description    Project    File    Line    Suppression State    Suppression State
Error        ADB0000:  Deployment failed
Mono.AndroidTools.InstallFailedException: Unexpected install output: cmd: Can't find service: package

   at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) in E:\A\_work\101\s\External\androidtools\Mono.AndroidTools\Internal\AdbOutputParsing.cs:line 345
   at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass95_0.<InstallPackage>b__0(Task`1 t) in E:\A\_work\101\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 753
   at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()             0

Wpf Designer with .Net Core 3 release version.

$
0
0

VS 16.3.1 And .Net Core 3.0 RELEASE versions. The designer is broken and has been through all the previews. It shows these errors but they are bogus because the app complies and runs fine. I just cannot use the Wpf designer. And yes I rebuilt the app to no avail. If I close the designer, the errors disappear. Why is this not fixed?

Issues Hosting ASP.Core 2.2 in ISS (inprocess)

$
0
0

Hello,

I am currently on defcon 2. I have a huge project which needed to be deployed yesterday but I can not get it run within IIS.

It is written in C# with target framework Core 2.2.

I have tried this so far and this one as well (on the application as well as a small scale test app.) and sadly non of those guides helped me out. It did not work and I got multiple different error which I will document later on.

I really do not understand this because the iis express which gets configurated by visual studio during debug session never had an issue. It is still working there.

Let me first show you my "Programm" class as well as my "Startup" class.

    public class Program
    {
        public static void Main(string[] args)
        {
            CreateWebHostBuilder(args).Build().Run();
        }

        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseStartup<Startup>();
    }


    public class Startup
    {

        public Startup(ILogger<Startup> logger, IConfiguration configuration)
        {
            _logger = logger;
            Configuration = configuration;

            if (UserManagementCache.GetInstance().Count <= 0)
                UserManagementCache.GetInstance().InvalidateCache();
        }

        private readonly ILogger<Startup> _logger;
        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {

            
            services.Configure<CookiePolicyOptions>(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });

            services.Configure<RazorViewEngineOptions>(options => 
            {
                options.FileProviders.Add(new CompositeFileProvider(
                    new EmbeddedFileProvider(
                        typeof(CurrentUserInfoControl).GetTypeInfo().Assembly,"Membrain.Web.Common"
                        )
                    ));
            });

            services.AddMemoryCache();
            services.AddDistributedMemoryCache();
            services.AddSession();
            services.AddKendo();

            services.AddAuthentication(IISDefaults.AuthenticationScheme);

            ServiceRegistrator.ConfigureServices(services);
            //services.AddAntiforgery(options => options.HeaderName = "X-CSRF-TOKEN");
            services.TryAddSingleton<IMenuHelper, MenuHelperImpl>(); 
            services.TryAddSingleton<IPageStateHelper, PageStateHelperImpl>();
            services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
            services.TryAddSingleton<IRoleEditStateHelper, RoleEditStateHelper>();
            services.AddMvc()
                .SetCompatibilityVersion(CompatibilityVersion.Version_2_2)
                .AddJsonOptions(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
            }

            app.UseStaticFiles();
            app.UseCookiePolicy();
            
            //enable session before MVC
            app.UseSession();



            app.Use(async (context, next) =>
            {
                if (context.User.Identity != null)
                {
                    var workContext = context.Session.GetSessionWorkContext();
                    var currentUserName = context.User.Identity.Name;
                    if (!string.IsNullOrEmpty(currentUserName))
                    {
                        if (workContext == null)
                        {
                            workContext = new WorkContext() { CurrentUser = new Core.Common.Business.UserToken(Guid.Empty, currentUserName) };
                            context.Session.SetSessionWorkContext(workContext);
                        }
                        else
                        {
                            if (workContext.CurrentUser != null)
                            {
                                //User did change!
                                workContext.CurrentUser = new Core.Common.Business.UserToken(Guid.Empty, currentUserName);
                            }
                        }
                    }
                    else
                    {
                        await context.Response.WriteAsync("Unable to identify the logged in user. Please try to login again via windows authentification.");
                    }
                }
                else
                {
                    await context.Response.WriteAsync("Unable to identify the logged in user. Please try to login again via windows authentification.");
                }
                await next();
            });

            app.UseMvc();



        }
    }


This is my current Web.Config:

<?xml version="1.0" encoding="utf-8"?><configuration><location path="." inheritInChildApplications="false"><!-- To customize the asp.net core module uncomment and edit the following section. 
  For more info see https://go.microsoft.com/fwlink/?linkid=838655 --><system.webServer><handlers><remove name="aspNetCore" /><add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /></handlers><aspNetCore  processPath="dotnet" arguments=".\Web.Administration.dll"  stdoutLogEnabled="true" stdoutLogFile="W:\Logs\Log" hostingModel="inprocess" /><security><authentication><anonymousAuthentication enabled="false" /><windowsAuthentication enabled="true" /></authentication></security></aspNetCore></system.webServer></location></configuration>

The IIS is configurated with:

Win Auth enabled

Anonym Login disabled

App pool created and that app pool has "No managed code" assigned.

Now to the issue description.

1)

I published with Deployment Mode Self-Contained.

In that combination I got a Internal Server Error 500.19 (screenshot) which is telling me that my configuration file is wrong.

I the msdn article about the support of Windows Auth for the core framework which can be found here.

However I am unable to find the configuration issues.

2)

After I removed the authentication part in the web.config I got a bit further ahead. (Still the self-contained package from before except the modified web.config)

Now I get a HTTP Error 500.31 - ANCM Failed to Find Native Dependencies (screenshot).

The logfile is giving me strange informations. It says:

______________________________________________________________________

Failed to load the dll from [C:\inetpub\WebAdmin\hostpolicy.dll], HRESULT: 0x800700C1

An error occurred while loading required library hostpolicy.dll from [C:\inetpub\WebAdmin\]

______________________________________________________________________

I double checked and the dll is existing withing the folder C:\inetpub\WebAdmin\

3)

Now it gets tricky. I tried another approach and changed the Deployment Mode from Self-Contained to "Framework-Dependend".

The target Framework is still netcoreapp2.2.

Here I get a HTTP Error 500.30 - ANCM In-Process Start Failure with not much info (screenshot)

However the iis process is having a unhandled exception and thatfor the log which he should write has been created but no content is in there.

This is actually a new behavior which I just got by walking through each step I tried so far.

Before this behavior I got this error: Access to the path 'C:\WINDOWS\system32\config\systemprofile' is denied

I tried to solve the access issue by giving the iis user the permission for this folder. The exception disapeared but I did not get the site. I got a random html content which bascially says "hello new asp.core user".

______________________________________________________________________

All those things did not work and I am all out of ideas. Anything has some ideas?

One last thing that confuses me to no end. My Project is a ASP.NET Core mvc project.

But in the project property site the  output it set to ConsoleApp (it actually generates the exe file as well as the qually named dll file). As I told you I have tried it on a smaller scale project. Which means I simply created an empy asp core app. In the project properties of this one it also had ConsoleApp set as output.

However after I build it the ouput directory only had the dll and never an additional exe file. I am telling you this because as far as I know the inprocess hosting of asp core withing iis required a dll as far as i Know.

I allways refered in the web.config to the dll but I am confused why the one project generates the console app and the other one does not (even thought both have console app as output).

Additionally I of course have installed all the sdk (2.2-3.0) as well as the asp core hosting bundle (runtime & sdk 2.2-3.0)

I hope you have some ideas because I really am stuck here.

Best regards

Simon


Dev86 Technical Blog


Is there a way to generate or get tempQueryId from "Copy Query URL" in TFS query editor?

$
0
0

I'm migrate an application connected to TFS to .Net Core.

In previous version I had a functionaly to download a .wiq file and it opens inside visual studio. From there I could go to web version of query editor.

Link is similar to: http://tfs/_queries/query/?tempQueryId={Guid}&resultsEditorContext=query-edit

For now application is a TFS extension and I want to open web query editor from there.

So the problem is how to get or generate this tempQueryId.

Thank you for your help!


Issues Hosting ASP.Core 2.2 in IIS (inprocess)

$
0
0

Hello,

I am currently on defcon 2. I have a huge project which needed to be deployed yesterday but I can not get it run within IIS.

It is written in C# with target framework Core 2.2.

I have tried this so far and this one as well (on the application as well as a small scale test app.) and sadly non of those guides helped me out. It did not work and I got multiple different error which I will document later on.

I really do not understand this because the iis express which gets configurated by visual studio during debug session never had an issue. It is still working there.

Let me first show you my "Programm" class as well as my "Startup" class.

    public class Program
    {
        public static void Main(string[] args)
        {
            CreateWebHostBuilder(args).Build().Run();
        }

        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseStartup<Startup>();
    }


    public class Startup
    {

        public Startup(ILogger<Startup> logger, IConfiguration configuration)
        {
            _logger = logger;
            Configuration = configuration;

            if (UserManagementCache.GetInstance().Count <= 0)
                UserManagementCache.GetInstance().InvalidateCache();
        }

        private readonly ILogger<Startup> _logger;
        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {

            
            services.Configure<CookiePolicyOptions>(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });

            services.Configure<RazorViewEngineOptions>(options => 
            {
                options.FileProviders.Add(new CompositeFileProvider(
                    new EmbeddedFileProvider(
                        typeof(CurrentUserInfoControl).GetTypeInfo().Assembly,"Membrain.Web.Common"
                        )
                    ));
            });

            services.AddMemoryCache();
            services.AddDistributedMemoryCache();
            services.AddSession();
            services.AddKendo();

            services.AddAuthentication(IISDefaults.AuthenticationScheme);

            ServiceRegistrator.ConfigureServices(services);
            //services.AddAntiforgery(options => options.HeaderName = "X-CSRF-TOKEN");
            services.TryAddSingleton<IMenuHelper, MenuHelperImpl>(); 
            services.TryAddSingleton<IPageStateHelper, PageStateHelperImpl>();
            services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
            services.TryAddSingleton<IRoleEditStateHelper, RoleEditStateHelper>();
            services.AddMvc()
                .SetCompatibilityVersion(CompatibilityVersion.Version_2_2)
                .AddJsonOptions(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
            }

            app.UseStaticFiles();
            app.UseCookiePolicy();
            
            //enable session before MVC
            app.UseSession();



            app.Use(async (context, next) =>
            {
                if (context.User.Identity != null)
                {
                    var workContext = context.Session.GetSessionWorkContext();
                    var currentUserName = context.User.Identity.Name;
                    if (!string.IsNullOrEmpty(currentUserName))
                    {
                        if (workContext == null)
                        {
                            workContext = new WorkContext() { CurrentUser = new Core.Common.Business.UserToken(Guid.Empty, currentUserName) };
                            context.Session.SetSessionWorkContext(workContext);
                        }
                        else
                        {
                            if (workContext.CurrentUser != null)
                            {
                                //User did change!
                                workContext.CurrentUser = new Core.Common.Business.UserToken(Guid.Empty, currentUserName);
                            }
                        }
                    }
                    else
                    {
                        await context.Response.WriteAsync("Unable to identify the logged in user. Please try to login again via windows authentification.");
                    }
                }
                else
                {
                    await context.Response.WriteAsync("Unable to identify the logged in user. Please try to login again via windows authentification.");
                }
                await next();
            });

            app.UseMvc();



        }
    }


This is my current Web.Config:

<?xml version="1.0" encoding="utf-8"?><configuration><location path="." inheritInChildApplications="false"><!-- To customize the asp.net core module uncomment and edit the following section. 
  For more info see https://go.microsoft.com/fwlink/?linkid=838655 --><system.webServer><handlers><remove name="aspNetCore" /><add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /></handlers><aspNetCore  processPath="dotnet" arguments=".\Web.Administration.dll"  stdoutLogEnabled="true" stdoutLogFile="W:\Logs\Log" hostingModel="inprocess" /><security><authentication><anonymousAuthentication enabled="false" /><windowsAuthentication enabled="true" /></authentication></security></aspNetCore></system.webServer></location></configuration>

The IIS is configurated with:

Win Auth enabled

Anonym Login disabled

App pool created and that app pool has "No managed code" assigned.

Now to the issue description.

1)

I published with Deployment Mode Self-Contained.

In that combination I got a Internal Server Error 500.19 (screenshot) which is telling me that my configuration file is wrong.

I the msdn article about the support of Windows Auth for the core framework which can be found here.

However I am unable to find the configuration issues.

2)

After I removed the authentication part in the web.config I got a bit further ahead. (Still the self-contained package from before except the modified web.config)

Now I get a HTTP Error 500.31 - ANCM Failed to Find Native Dependencies (screenshot).

The logfile is giving me strange informations. It says:

______________________________________________________________________

Failed to load the dll from [C:\inetpub\WebAdmin\hostpolicy.dll], HRESULT: 0x800700C1

An error occurred while loading required library hostpolicy.dll from [C:\inetpub\WebAdmin\]

______________________________________________________________________

I double checked and the dll is existing withing the folder C:\inetpub\WebAdmin\

3)

Now it gets tricky. I tried another approach and changed the Deployment Mode from Self-Contained to "Framework-Dependend".

The target Framework is still netcoreapp2.2.

Here I get a HTTP Error 500.30 - ANCM In-Process Start Failure with not much info (screenshot)

However the iis process is having a unhandled exception and thatfor the log which he should write has been created but no content is in there.

This is actually a new behavior which I just got by walking through each step I tried so far.

Before this behavior I got this error: Access to the path 'C:\WINDOWS\system32\config\systemprofile' is denied

I tried to solve the access issue by giving the iis user the permission for this folder. The exception disapeared but I did not get the site. I got a random html content which bascially says "hello new asp.core user".

______________________________________________________________________

All those things did not work and I am all out of ideas. Anything has some ideas?

One last thing that confuses me to no end. My Project is a ASP.NET Core mvc project.

But in the project property site the  output it set to ConsoleApp (it actually generates the exe file as well as the qually named dll file). As I told you I have tried it on a smaller scale project. Which means I simply created an empy asp core app. In the project properties of this one it also had ConsoleApp set as output.

However after I build it the ouput directory only had the dll and never an additional exe file. I am telling you this because as far as I know the inprocess hosting of asp core withing iis required a dll as far as i Know.

I allways refered in the web.config to the dll but I am confused why the one project generates the console app and the other one does not (even thought both have console app as output).

Additionally I of course have installed all the sdk (2.2-3.0) as well as the asp core hosting bundle (runtime & sdk 2.2-3.0)

I hope you have some ideas because I really am stuck here.

Best regards

Simon


Dev86 Technical Blog



eewgegew

Why Selenium ChromeDriver try to authorize with my AD username on Windows 10

$
0
0

Hello there,

I'm new to all that C# world, but I'm trying to write some nUnit tests. I also use Active Directory authentication for my Windows via JumpCloud. Otherwise, there is no problem with my tests, Chrome is opens and tests executed properly. I take the instance of ChromeDriver in that way:

var assembly = Assembly.GetExecutingAssembly();
var directoryName = Path.GetDirectoryName(assembly.Location);

return new ChromeDriver(directoryName);
The problem is when I use ChromeDriver and run my tests my account is being blocked because of too many wrong login attempts. After digging into the JumpCloud logs I found the following line<g class="gr_ gr_1006 gr-alert gr_gramm gr_inline_cards gr_run_anim Style replaceWithoutSep" data-gr-id="1006" id="1006">:</g>
User <username> failed to login from <nil>, process name: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

<g class="gr_ gr_1006 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Style replaceWithoutSep" data-gr-id="1006" id="1006">And</g> my question is: why that chrome trying to log in anywhere, even more with my AD credentials.

I'm not sure whether the theme is in the right one, and whether it is a problem of my Windows, Visual Studio, ChromeDriver, JumpCloudor something else entirely.

300+ machines to enble Bitlocker

$
0
0

Hi All,

I have a task to enable  Bitlocker in 300+ domain joined windows machines, I can create a group policy but from the desktop i dont want users  should work on the  individudal machines to enable this bitlocker and encryption .

Regards

Abhay



Regards Abhay

sending video frames over Ethernet

$
0
0

Hi, 

I am an embedded programmer. I am working on a system which captures h.264 compressed video data from a hardware and save it in an avi file container. The driver of the hardware does not supports directshow. Therefore I had to stick on manufacturer's APIs and callback functions. I receive each frame and write it in an avi File. Till now everything is  working fine.

Now I need to send these captured frames over Ethernet to another PC, where we want to see the captured video frames on VLC player, in order to make sure everything is working fine. Please tell me how can I stream these video frames over ethernet. Till now, i have explored that I need to convert each video frame into rtsp stream and then send it to ethernet. But I dont have any such live streaming background. Can you recomend any c++ program that can help me to send the data over ethernet so that we can stream it on VLC player on other computer (using live frame from compression card). I have windows 7 at both ends.

regard 

Aamir 

Powershell AD and Exchange update script

$
0
0

Hi

I have made a PowerShell script that creates a user in AD and then create the mail contact in Exchange

Running the script creates the user in AD but the creation in Exchange is running in its own session due to needed authentication and to me it looks like the script is not waiting for the Exchange session to complete before completing.
Anyone know how to do this?

Running the script for 100 users makes the Exchange sessions pile up and execute slow even though the script is already completed which means that error handling fails

Br. Jesper

ASP.NET Core MVC Session Alternative ?

$
0
0

Hello,

I'm developing e-commerce system asp.net core mvc, I use session but I think this is a bad method. For example if user not make action session boom. I want to generate token and use.

Does that make sense ? What is your suggestions ?



Unable to upload script in technet gallery

$
0
0
I am unable to upload script in technet gallery. It is showing the following message "Sorry, you don't have privilege to upload a sample."

AxVLCPlugin2 end ftp streaming before i want

$
0
0
Hi

i write a c# application to render a video saved on Ftp folder.  The control show about one minute of video and than video blocking and audio go on. I set some optiontion playlist but these didn't work..


the code is the following:

// These are all option that i have proove
 string[] options =new string[] {
                     //"--plugins-cache",
                     //"--no-plugins-cache",
                     //"--no-start-paused "
                     //":ftp-caching=600 "
                     //":network-caching=10000",
                     ":network - caching = 60000",
                     ":file - caching = 60000",
                     ":network - timeout = 10000000"              
     // "--ftp - account ="
//"--no-one-instance",
//"--no-loop",
//"--no-drop-later-frames",
//"--disable-screensaver"
            };

       

                    this.axVLCPlugin21.playlist.add("ftp://User:Password@Ip:Port/FtpFolder/GlassesVideo.mp4", options);


                //this.axVLCPlugin21.playlist.playItem(0);
                this.axVLCPlugin21.playlist.play();
                ///this.Test();


Have you any idea Why?

Valentina Tavanti

Problema de Conexion a hand Puch 3000 por medio de la DLL RsiDotNetDLL

$
0
0

Hola a todos, disculpen las molestias, tengo un problemita, resulta que tengo un handpunch 3000 en mi manos, y me mandaron a desarrollar un sistema de control de asistencias, resulta que el handpunch 3000 lo configure con una ip (172.17.2.209) la cual hacer un ping desde mi pc , me figura que recibe la información.

pero al generar el código , donde me devolvería un 1 ( estado 1 es recibido) devuelve un 0, e estado semanas trabajando en esto, pero no logro generar la conexión, si alguien me puede ayudar se lo agrade cedería mucho, adjunto código , saludos.

Imports RecogSys.RdrAccess
Public Class Form1

    Private myIP As CRsiComWinsock = New CRsiComWinsock()
    Const bTRUE As Integer = 1
    Const bFALSE As Integer = 0
    Private myNetwork As CRsiNetwork = New CRsiNetwork()
    Private myRdr As CRsiFingerReader = New CRsiFingerReader()
    Private Result As Integer

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        myIP.SetHost("172.17.2.209")

       myIP.EnablePing()
      
        If myIP.Ping = bTRUE Then
            If myIP.Connect = 0 Then
                myIP.Disconnect()
                myIP.ResetSocket()
                myIP.Connect()
            Else
                '''' no pasa nunca
            End If
        Else
            MsgBox("no conecto")
        End If

        If bFALSE = myIP.IsConnected Then
            'Throw New Exception("Unable to establish a connection")
            MsgBox("Unable to Ping IP Address")

        Else
            'leer huella
       
        End If

    End Sub

End Class


Shamnger by Arthemiaz

REST /SOAP interface - Client

$
0
0
Hello,
I need to develop a REST / SOAP interface
Get    https://xxxxxOneObject:8443
Get    https://xxxxxList:8443

Order
{
  "OrderNumber" : "73620190930","ProductNumber" : “RECEIVER_TVK1280/01","ProductRevision" : "R1",“NrPerIndividual" : "8"
}

List<Order>  ListOrder
I get an object order back and in the second case a list of possible orders.
My questions are. What's the best way to do that? How can I test it myself? Can I simply write a REST server that returns data to me?
Thank you for your tips.
Greetings Markus


Power BI features and APIs

$
0
0

Hi,

We are planning to use Power BI for reporting needs in project. Currently we are trying to checkout features of Power BI and see if these can be achieved, so far we have not been able to make much progress on this. Can someone please provide pointers on how this can achieved,

Its Angular app with .NET Core middleware and Azure SQL DB back-end.

1. Application has 4 screens each displaying different dataset. There is a Preview button on UI, on clicking the button, a consolidated report from dataset in all 4 screens has to be displayed on a dashboard and this dataset is for a particular date user would have selected on the screen. We found few articles that explain how to embed Power BI reports on Angular app which we are yet to try out. But, are there ways to pass parameters to Power BI dashboard like a particular date, looks like dashboard URL by default loads the entire dataset and user has to interact with the report for using filters.

2. On certain user action on the UI like button click event, report for the particular selected date has to be extracted as an excel (with all the report dashboard formatting intact) and emailed as an attachment to certain distribution list.

Looking for pointers/options to implement these.

Thank you.

Not able to find a relevant category for Power BI so tagged to Other Forums.

Viewing all 13882 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>