Real time Log mechanism while importing large files with blazor server app - asp.net-core

I m using blazor server app and importing large files. During import operation service will be logged errors and warnings. Users want me to show logs real time.Should I use Signal-R. Because I needed updates one way.

Related

Visual Studio LightSwitch HTML project will not deploy database schema to Azure SQL Database

I ran into deployment issues, so I created a test app to prove out the deployment process. I've kept everything as "out of the box" as possible:
I've created a simple (one table and one screen) VS2013 LightSwitch HTML client app, but the deployment fails, because it will not deploy the database schema.
I've created the Azure website and linked it to my Azure SQL Database, also the "Deploy database schema" checkbox is checked in the wizard.
It seems that my only option at the moment is to manually create the DB objects, which seems kind of absurd.
I have found a workaround to this issue.
It seems that the problem stems from not having the deployment credentials. What I have found is that if I attempt to deploy the server project there is a drop down list box that's supposed to be populated with available destinations. At the first attempt the list comes up blank but if I proceed to publish a message flashes up confirming a new set of credentials has been downloaded. After that I found I am able to publish the main project itself database objects as well.
In short; make sure you are properly logged in even if you have to log out and then in again, and also have deployment credentials up to date.

Import data from CouchDB to Sql Server

Is there a way to export data from couchDB to Sql Server ?
We tried with SSiS using http connection manager, JSON component source etc. But the problem is that couchDB has some security and we can't retrieve data info. We tried installing their certificates no success.
Any other suggestions?
CounchDB has a number of .net client libraries you can use. I would get that working in a console app and then just write that to a csv on the disk and use SSIS to import it.
If you don't want the additional step you could write a .net script source component that used the .net client to retrieve data but get it working in a console app first so you know it is good before bringing SSIS into the equation.
Getting started with CouchDb and c#:
https://wiki.apache.org/couchdb/Getting_started_with_C%23
ed

What permissions/policies are needed to support loadUserProfile=true for new application pools?

Something happened on my development workstation (Windows 8.1) in the last few weeks which require me to either run my App Pools with the "Load User Profile" setting at False or not run with the identity set to ApplicationPoolIdentity. If I were to create a new app pool, using ApplicationPoolIdentity as the identity and with loadUserProfile=true, the following happens when trying to load the application in a browser:
A number of errors in the Windows Event Log (both System and Application types):
Warning event 1509 - Windows cannot copy file \\?\C:\Users\Default\AppData\Local\Microsoft\VSCommon\12.0\SQM\sqmdata-7236-039-00000.sqm to location \\?\C:\Users\[Name of App Pool]\AppData\Local\Microsoft\VSCommon\12.0\SQM\sqmdata-7236-039-00000.sqm. This error may be caused by network problems or insufficient security rights.
Error event 1511 - Windows cannot find the local profile and is logging you on with a temporary profile. Changes you make to this profile will be lost when you log off.
Another 1509 warning
Error event 1500 - Windows cannot log you on because your profile cannot be loaded. Check that you are connected to the network, and that your network is functioning correctly. DETAIL - Only part of a ReadProcessMemory or WriteProcessMemory request was completed.
5 x event 5022 warnings - The Windows Process Activation Service failed to create a worker process for the application pool '[App Pool Name]'. The data field contains the error number.
Finally an error 5002 - Application pool '[App Pool Name]' is being automatically disabled due to a series of failures in the process(es) serving that application pool.
The App Pool is shut down, as the error 5002 said
"HTTP Error 503. The service is unavailable." is then seen in the browser. Any further requests are met with the same (which makes sense since the app pool is shut off).
I've seen a common "fix" for this here and here which basically say to turn off profile loading. Yes it makes the problem go away, but this doesn't get to the root cause. I know that it is possible to run with this configuration as a I have a Windows 2012 machine which supports the configuration just fine. In this case, hitting an app with a new app pool set to ApplicationPoolIdentity and loadUserProfile=true actually creates the new user profile (I can watch as the profiles folder is created in C:\Users) and the app runs merrily. What's worse is I know this configuration worked on the problem machine just a few weeks ago. I have a number of App Pools I created which have their own profiles and folder under the C:\Users folder. These app pools work just fine NOW with the ApplicationPoolIdentity and loadUserProfile=true settings. It's just that NEW app pools refuse to run and load a user profile.
Does anyone have any insight to what might be going on?
Edit: I read the bottom of this recent article. It's a bit contradictory in saying that the setting can be turned on, but also says:
Only the standard application pools (DefaultAppPool and Classic .NET AppPool) have user profiles on disk. No user profile is created if the Administrator creates a new application pool.
However, if you want, you can configure IIS application pools to load the user profile by setting the LoadUserProfile attribute to "true".
I'm very confused.
The SQM file listed in the event log warning was created by a Windows or Visual Studio update. When the user profile service or application pool runs and tries to create a new profile, it tries to copy the file to the profile. The SQM file requires administrator permissions to copy. The user profile service or application pool does not have sufficient permissions to copy the file, an error is generated, and the user profile is not created. Without a user profile, the application pool cannot run because it doesn't have an isolated secure place to store data.
Remove or delete the SQM file from the source directory, and the user profile will be created successfully when the app pool is initialized. You can also change the permissions on the SQM file, but I'm not sure what the appropriate permissions should be. The user profile service runs as "LocalSystem Account". See its documentation for permission info. It's unclear to me whether the application pool identity itself is being used to perform the copy operation, or the local system account.
If you remove the file from the source directory, you could also manually copy the file where it was trying to go as well.
After a very brief search about what SQM is, it seems like it is traditionally used as "service quality management". Usually it would contain information to send back to the program authors with metrics, logs, or somesuch. I don't know if this is the case with this file or not. So it doesn't seem like it's important to include it in the new profile.
I can't take 100% credit for this answer, as I was tipped off by a comment attached to an answer on some other question. I can't find the link to it in the 50 browser tabs open for troubleshooting this. That guy deserves a thank you, because I believe this is a much better solution than compromising the security of a server by pooling all the resources together like in IIS 6.
P.S. As noted in your comment, a bug report has been filed.

clickonce update, avoid change to installed program config file

I store connection string and other settings in application.setting(config)
also deployed c# app with click once and published it on the web server to be accesible for my clients easily.
but the problem is when the user install app from web server and set its customized settings on application then, each time I publish new version of my app ,when client update the app from web server then its current application setting will be replaced by file that I published on server so connection string of application on my system will set for the client in consequence client app could not connect to his db because of connection string changes pls let me know if there is a solution to avoid updating setting by click once?
It's not safe to store your data in the ClickOnce cache. Check out this article, which explains how to move it to LocalApplicationData so it is unchanged by updates.

How to build vb.net application so that database is easily connected when published?

I've made VB.NET application in VS2010 that uses a 2007 Access database, called MenuDB.mdb. During development, everything was fine.
Now that I'm publishing it, I'm getting weird errors because for some reason the app isn't connecting to the database.
I install the application and run it but as soon as it opens it gives this error:
System.Data.OleDb.OleDbException (0x80004005): Could not find file
'C:\Users\Administrator\AppData\Local\Apps\2.0\Data\OV86PXJA.K3R\8575R5AY.95Z\menu..tion_0d4fa454d69e8e6b_0001.0000_8340d263807cbb71\Data\MenuDB.accdb'.
I know the problem has to do with the way I'm relating the application to the database, but I don't know which way is right. In Solution Explorer I changed the Build Type of MenuDB.accdb to "Content" (earlier it was embedded resource". But it doesn't work either way. In my App.config I have the following connection string:
connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\MenuDB.accdb"
I want that when I deploy the application, the database should just sit in the application folder, wherever it gets installed. How can I do that?
Edit
I don't mind deploying it in such a way that I need to paste the database somewhere myself on the target machine - as long as it works.
If you have multiple users using the same or similar database, and dont have access to a SQL server (MySQL, MSSQL, or others), then co-locate the database at a central location (preferably network location) that all the users will have access to and change the connection string to accomidate the database location being on the network.
Just let it be known, Access can handle up to 10users when doing simple data retrieval/submission but if you ever have it open while others are accessing via data objects, then you may lock them out.