Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all 8156 articles
Browse latest View live

Framework class for managing byte arrays efficiently

$
0
0

I swear I've seen this in the framework a while ago, but for the life of me I can't find it.

What I'm looking for is a class that I can lease a byte array of X length from. The class determines if it has any cached arrays of that minimum length. If it does, it leases one to me. If it doesn't, it creates a new one and gives it to me. When I'm done with the array, I release it back to the cache which then holds onto it, waiting to see if I'll ask for an array of length X that is equal to or lesser than the length of that array.

I'm not interested in 3rd party products (I can find those fine), I just want to know if that exists in the framework. 

I'm not talking about the MemoryCache/ObjectCache. Those aren't specialized to byte arrays and do not lease existing or new arrays based on a minimum length. Anything that doesn't support that exact scenario I'm not interested in, unless it's almost the same and the difference is made up by the smooth parts of my brain. 


Failure sending attachment mail using SMTP in C#

$
0
0

Hi 

We are sending mail using SMTP class in a console application. We are sending the mails with an attachment in a loop. All the mails are sent successfully except the one and getting below exception. My assumption is it might be failing due the size of the file. The file size is almost 4.5 Mb . We checked but didn't find any  option to set the file size limit.

We have tried to increase the data size in config too but no success. Added below in app.config

<system.web>
    <httpRuntime maxRequestLength="1048576"/>
</system.web>
  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="1073741824" />
      </requestFiltering>
    </security>
  </system.webServer>

Error Message   : Failure sending mail.Inner Exception :System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.Security._SslStream.StartWriting(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security._SslStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.DelegatedStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at System.Net.DelegatedStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at System.Net.Mime.EightBitStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at System.Net.DelegatedStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at System.Net.DelegatedStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at System.Net.Mime.EightBitStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at System.Net.DelegatedStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at System.Net.DelegatedStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at System.Net.Base64Stream.FlushInternal()
   at System.Net.Base64Stream.Close()
   at System.Net.Mime.MimePart.Send(BaseWriter writer, Boolean allowUnicode)
   at System.Net.Mime.MimeMultiPart.Send(BaseWriter writer, Boolean allowUnicode)
   at System.Net.Mail.Message.Send(BaseWriter writer, Boolean sendEnvelope, Boolean allowUnicode)
   at System.Net.Mail.MailMessage.Send(BaseWriter writer, Boolean sendEnvelope, Boolean allowUnicode)
   at System.Net.Mail.SmtpClient.Send(MailMessage message)Strack Trace :   at System.Net.Mail.SmtpClient.Send(MailMessage message)

Below is the code snippet:

MailMessage mail = new MailMessage();

                using (SmtpClient SmtpServer = new SmtpClient(MailSERVER, 25))
                {
                    mail.From = new MailAddress(DisplayEmailAddress);
                    mail.To.Add(userEmailAddress);
                    mail.Subject = MailSubject;
                    mail.Body = MailBody;
                    System.Net.Mail.Attachment attachment;
                
                    attachment = new System.Net.Mail.Attachment(filePath);
                    attachment.Name = filename;
                    mail.Attachments.Add(attachment);
                    
                    SmtpServer.UseDefaultCredentials = false;
                    SmtpServer.Credentials = new System.Net.NetworkCredential(MailUSERNAME, MailPASSWORD);
                    SmtpServer.EnableSsl = true;
                    SmtpServer.Send(mail);
                }

So, what change we can do to resolve the issue. 

USB Communictaion

$
0
0

Hi,

I have worked with Serial and TCP communication.However i've never worked  with USB communication.Have anyone worked with the same,I have read some documents that mentions abt Vendor Id and Product Id necessary for USB communication.As I don't have a USB device for communication can anybody suggest how to try out samples of USB communication.For Serial u have Hyperterminal for testing.I do have a Usb stick is it anyway useful for testing usb communication.Pls suggest

System.Drawing.Graphics.MeasureString() does not return a exact width for "Sakkal Majalla" font

$
0
0

Hi All,

In our requirement, we are converting a Microsoft Word to PDF with in our library. To achieve this requirement, we measure a string with required font by using  System.Drawing.Graphics.MeasureString(). Here, when we try to measure the text "الرقم" with "Sakkal Majalla" font, it does not return the exact width as per MS Word does.

Please find the below code snippet that we are using to measure the text,

            //Create a bitmap
            Bitmap bmp = new Bitmap(1, 1);

            //Set the resolution of the bitmap as 120, 120
            bmp.SetResolution(120, 120);

            //Get the graphics from bitmap
            Graphics _graphics = Graphics.FromImage(bmp);
            //Set graphics page unit as point
            _graphics.PageUnit = GraphicsUnit.Point;

            //String to measure
            string text = "الرقم";

            //String format to measure
            StringFormat stringFormat = new StringFormat();
            stringFormat.FormatFlags = StringFormatFlags.FitBlackBox;
            stringFormat.FormatFlags |= StringFormatFlags.MeasureTrailingSpaces;
            stringFormat.FormatFlags |= StringFormatFlags.NoClip;
            stringFormat.Trimming = StringTrimming.Word;

            FontStyle fontStyle = FontStyle.Bold;

            //Create System.Drawing.Font to measure
            Font font = new Font("Sakkal Majalla", 14, fontStyle);

            //Measure the string with GDI
            SizeF size = _graphics.MeasureString(text, font, new PointF(0, 0), stringFormat);

            //Return a width of the text as 27.890625
            float width = size.Width;

By using this measuring code, it return a width of the text as "27.890625" point but when we measure the same text with MS Word it's fit the specified text with in "21.95" point. 

How we measure the text in MS Word?

We are measuring a text in MS Word by fit the text with in the simple table cell with required font. After fitting that text in a cell, we consider that width of the cell as text width.

Could you please suggest us a solution to get the same width as in MS Word via Graphics.MeasureString().

Thanks,

Ramaraj Marimuthu


ISO date time conversion issue

$
0
0
-3
<button aria-label="down vote" aria-pressed="false" class="js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer" data-selected-classes="fc-theme-primary" style="margin:2px;box-sizing:inherit;font:inherit;padding:0px;border-width:initial;border-style:none;border-color:initial;border-radius:3px;background-image:none;background-background-size:initial;background-repeat:initial;background-attachment:initial;background-origin:initial;background-clip:initial;outline:none;box-shadow:none;" title="This question does not show any research effort; it is unclear or not useful"><svg aria-hidden="true" class="svg-icon m0 iconArrowDownLg" height="36" viewBox="0 0 36 36" width="36"><path d="M2 10h32L18 26 2 10z"></path></svg></button><button aria-label="favorite" aria-pressed="false" class="js-favorite-btn s-btn s-btn__unset c-pointer py8" data-selected-classes="fc-yellow-600" style="margin:0px;box-sizing:inherit;font:inherit;padding:0px;border-width:initial;border-style:none;border-color:initial;border-radius:3px;background-image:none;background-background-size:initial;background-repeat:initial;background-attachment:initial;background-origin:initial;background-clip:initial;outline:none;box-shadow:none;" title="Click to mark as favorite question (click again to undo)"><svg aria-hidden="true" class="svg-icon iconStar" height="18" viewBox="0 0 18 18" width="18"><path d="M9 12.65l-5.29 3.63 1.82-6.15L.44 6.22l6.42-.17L9 0l2.14 6.05 6.42.17-5.1 3.9 1.83 6.16L9 12.65z"></path></svg>
</button>

i have a web application with calender control if i am chosing 15 of Aug 2019 and submitting the data i am receiving the date in my web api as 2019-08-14T18:30:00Z then i am converting the datetime as follow string[] formats = { "yyyy-MM-ddTHH:mm:ssZ" }; var parsedDate = DateTime.ParseExact("2019-08-14T18:30:00Z", formats, CultureInfo.InvariantCulture, DateTimeStyles.None).ToString();

which is converting and giving me the desire date that is 08/15/2019 12:00:00 AM but while saving into the sql server db it is getting saved as 08/14/2019 12:00:00 AM

there is a day difference in the actual date and the saved date. How to solve this issue. Below is the Web API code to save into the sql server DB.

public IHttpActionResult Insert(ODataActionParameters parameters)
    {

        ResponseObject dataOp = new ResponseObject();          
        string[] formats = { "yyyy-MM-ddTHH:mm:ssZ" };

        var startDate = DateTime.ParseExact(parameters["StartDate"].ToString(), formats, CultureInfo.InvariantCulture, DateTimeStyles.None).ToString("dd-MM-yyyy");          

        try
        {               
            validToken = true;
            if (validToken)
            {
                    using (SqlConnection dbConnection = new SqlConnection(connectionString))
                    {
                        if (dbConnection != null && dbConnection.State == ConnectionState.Closed)
                        {
                            dbConnection.Open();
                        }

                        scCommand.Parameters.AddWithValue("@StartDate", parameters["StartDate"] == null ? DBNull.Value.ToString() : startDate);

                        scCommand.CommandType = CommandType.StoredProcedure;
                        scCommand.ExecuteNonQuery();

                        dataOp.TaskStatus = true;
                        dataOp.Message = "Inserted Successfully start date= " + parameters["StartDate"].ToString();
                        dataOp.AddnMessage = message;                           

                    }                   

            }
            else
            {
                dataOp.TaskStatus = false;
                dataOp.Message = "Invalid Token";
                dataOp.AddnMessage = message;
            }
        }
        catch (Exception ex)
        {
            addLogs(ex.ToString());
            dataOp.TaskStatus = false;
            dataOp.Message = ex.Message + "\n" + message;
        }
        return Ok(dataOp);
    }

Documentation of Common Use Cases for any .NET Class Library Namespace

$
0
0

In a .NET Class Library Namespace, there are many classes, interfaces, delegates, enums etc. Tounderstand the functionality of a namespace, I would like to identify the common use cases for the classes in that namespace. Where can I find such documentation ? A specific example of what I am talking about are the use cases for WCF Web Services given by the following link: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-netod/47e2ce29-25ba-4537-8952-f3c23b3781c3.

Your answer would be much appreciated. Thank you in advance.

Type.GetTypeFromProgID does not work for remote server

$
0
0

Type.GetTypeFromProgID does not seem to work when remote server is specified, when the ProgID is not registered in the local server. I think it is a bug. I could not find any reference about the solution for this. The framework we tested is 4.5.1. 

Any idea of when this would be fixed?

=HUG@$$https://nfllivenfl.com/alabamavsduke/

$
0
0
https://nfllivenfl.com/clemsonvsgeorgiatech/
https://4ktvvs.com/clemsonvsgeorgiatech/

https://nfllivenfl.com/alabamavsduke/
https://4ktvvs.com/alabamavsduke/

https://nfllivenfl.com/pennstatevsidaho/
https://4ktvvs.com/pennstatevsidaho/

https://nfllivenfl.com/wisconsinvssouthflorida/
https://4ktvvs.com/wisconsinvssouthflorida/

https://nfllivenfl.com/ohiostatevsfloridaatlantic/
https://4ktvvs.com/ohiostatevsfloridaatlantic/

lg الان اصلاح ثلاجات ال جى الفيوم 01223179993 | 01207619993 صيانة ال جى

$
0
0

lg الان اصلاح ثلاجات ال جى  الفيوم  01223179993 | 01207619993 صيانة  ال جى

lg الان اصلاح ثلاجات ال جى  الفيوم  01223179993 | 01207619993 صيانة  ال جى

lg الان اصلاح ثلاجات ال جى  الفيوم  01223179993 | 01207619993 صيانة  ال جى

Type.GetType("ns.MyType, MyAssemblyName") returned null unless add project reference in Visual Studio

$
0
0

Hi,

I'm using Visual Studio 2019, .NET CORE 2.2 (and also tested with .NET CORE 3.0 preview 8) on Windows 10.

Say I have 2 C# projects in VS: MainProject, MyTypeProject (output dll name: MyTypeAssemblyName.dll, no version and no assembly sign).

Test Case 0, the 2 projects have no reference, manually build theMyTypeProject and copy the MyTypeAssemblyName.dll into MainProject's output, then I call

Type.GetType(Type.GetType("ns.MyType, MyTypeAssemblyName"))

in MainProject, it returned null.

Test Case 1, I referenced MyTypeProject in MainProjectin VS, I build MainProject, can see the MyTypeAssemblyName.dll auto copied into output, then call that code again, it can get the expected type.

I also tried with 

Type.GetType(Type.GetType("ns.MyType, MyTypeAssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken="))

the result are the same with above: no project reference then null.

so how the source code project reference make this different?



This is shawn.

.Net ActiveX component failing after .Net 4.8 upgrade

$
0
0

My company has written a couple of .Net ActiveX components that have been running just fine for several years. The components are written in C# and are dependent on .Net 4.5, but run okay on newer versions of .Net, including .Net 4.8.  Recently, we have had customer complaints that these components have stopped working after upgrading to Windows 10 1903.  The components appear to work fine for most users that have upgraded to 1903, though.  We have not been able to reproduce this issue in-house, so troubleshooting has been very difficult. We have spent many hours attempting to discover what is not working properly through remote sessions with these customers.  

We originally posted the question here:

https://social.technet.microsoft.com/Forums/windowsserver/en-US/739ef74c-5e7d-431a-a44b-a799222a8071/net-activex-component-failing-after-windows-10-1903-upgrade?forum=win10itproapps

Since that post we have determined that the issue is upgrade to .Net 4.8 and not Windows 10 1903.  We know that Windows 1903 includes .Net 4.8, so those two things are tied together.

We do have a .Net dll compiled for x86, and we're running it on both 32bit and 64bit OSs.  We have COM registry entries required.  It worked fine in .Net 4.7.2.  We have proven that this can fail on Windows 7 PCs that have moved to .Net 4.8.  I believe we have ruled out that this is a Windows 10 1903 problem.  Instead it is a .Net 4.8 problem.

I’ll provide a summary here of what we have tried.

1.       We attempted to target .Net 4.8 specifically.  This had no effect.

2.       We built a .Net C# test program that executes the ActiveX component directly and tests the interface.  This test program was able to load the dll and execute tests without any issue on the broken Windows 10 1903 machines as well as a few broken Windows 7 machines with the .Net 4.8 upgrade.

3.       We built a .Net C# test program that attempts to load the ActiveX component via ActiveX.  Basically it tries to instantiate the ActiveX component from the ProgID like this:

dynamic obj = Activator.CreateInstance(Type.GetTypeFromProgID("ISActiveX.ISActiveXMain"));

Then the test program calls methods on obj.  When tested on a working system, the test program runs great and can test the interface just fine.  When run on a broken Windows 10 1903 system, the call throws an exception. Here is the stack trace:

System.IO.FileNotFoundException: Retrieving the COM class factory for component with CLSID {3D5F3F28-F066-4F24-B142-6B8720A46691} failed due to the following error: 80070002 The system cannot find the file specified. (Exception from HRESULT: 0x80070002).

   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)

   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)

   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)

   at System.Activator.CreateInstance(Type type, Boolean nonPublic)

   at System.Activator.CreateInstance(Type type)

   at ISActiveXTest2.Program.Main(String[] args)

Unfortunately, we haven’t been able to figure out what file is not found.  Our component doesn’t depend on anything other than the built-in .Net Framework assemblies.  We suspect that some underlying system dependencies are missing, but we have no way to know what those might be.

4.       We wrote a program to enumerate the registry keys we know to be required to properly register our ActiveX component.  This generates a positive result on the broken Windows 10 1903 systems, so that was a nice double-check, but we did not learn anything new.

5.       We used Process Monitor to take a look at what registry keys and such are being accessed.  We can see from the registry access that the program attempts to access many keys related to our ActiveX component in order to start it up.  It actively attempts to get keys from HKEY_CLASSES_ROOT first, and when it fails to find the entries, it goes to HKEY_CURRENT_USER instead.  This seems to work happily for so many keys, but when it hits this key below, it does not try for the HKCU equivalent and it then seems to go into an error state (noting this GUID below is owned by our component and the HKCU equivalent is present in the registry):

HKCR\WOW6432Node\CLSID\{3D5F3F28-F066-4F24-B142-6B8720A46691}\InprocServer32

Right after this last registry access, there are a number of file accesses related to mscorrc.dll.  We don’t know what mscorrc.dll does, but we did not see this dll being accessed when compared with a successful run of the component on other systems. 

6. We ran some scans that didn't help.

sfc /scannow
Dism /Online /Cleanup-Image /CheckHealth
Dism /Online /Cleanup-Image /ScanHealth
DISM /Online /Cleanup-Image /RestoreHealth

So far, none of these have resolved the problem.  Fortunately, we have finally found a PC in our own organization that is exhibiting this behavior, so we are able to run more experiments on a cloned VM of it without fear of destroying a customer PC.

7. We have reviewed Fusion logs and we don't see any binding issues:

https://www.inflectra.com/support/knowledgebase/kb171.aspx

8. We added COM tracing, but it didn't give any new information:

https://support.microsoft.com/en-us/help/926098/how-to-enable-com-and-com-diagnostic-tracing

9. We tried the .Net Framework repair tool, but apparently it doesn't even support .Net 4.8 (yet).

10. On Windows 7, we found combase.dll missing on these PCs, but adding it didn't seem to help.  ProcMon showed that combase.dll was being requested, but after adding ProcMon showed it doing some activity on combase.dll but no change in the result.

11. We did run the old depends.exe program on mscoree.dll and found some differences in product and file version of dependency dlss on working vs non-working PCs.  We're not convinced that depends is actually reporting the proper information, though, as winsxs does a great deal of mysterious work to get the required dll loaded and we could very well be looking at the wrong things.

At this point, we’re looking into options to write an ActiveX interface layer in C++ to bypass the problem with .Net failing to activate the component.  That effort will take some time.  We could really use some suggestions on how to troubleshoot this any further.  We know the direct cause is the 1903 upgrade as rollback to the previous version resolves the issue.  We also realize this could just be caused by the .Net 4.8 upgrade that comes along with 1903.

Is there any way to debug or log activity that occurs during .Net ActiveX component instantiation?

How can we find out what file is missing, as the stack trace indicates?

HELP

$
0
0
Please in simple terms tell me how to fix this error. Net Framework 3.5 and 4.5 error 0x80070002

Porting code from .net to .net standard into OSS project

$
0
0
Hello,

I'm working with some legacy code that is using some classes (Uritemplate and UriTemplateMatch) that are present in the .net framework but not for .net core.

I ported the source code manually into a .net core open source module and I wonder if that is against the Microsoft license for .net framework. This will allow to port my legacy app to .net core without changing its code.

Here is my porting or UriTemplate and UriTemplateMatch classes

I'm happy to add any reference to Microsoft original source or remove from internet in case is breaking any copyright.

Can you please confirm if I'm allowed or not allowed to copy code from .net into a OSS project for backward compatibility?

Many thanks

Custom font not working in MailMessage

$
0
0
<style type="text/css">p.p1 {margin: 0.0px 0.0px 12.0px 0.0px; line-height: 14.0px; font: 12.0px Times; color: #000000; -webkit-text-stroke: #000000} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px Courier; color: #000000; -webkit-text-stroke: #000000} p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px 'Courier New'; color: #000000; -webkit-text-stroke: #000000} span.s1 {font-kerning: none} span.s2 {font: 12.0px 'Courier New'; font-kerning: none} span.s3 {font: 12.0px Courier; font-kerning: none} </style>

Hi,

I am trying to send below body using MailMessage and the IsBodyHtml is working fine but I am not getting the expected font.

Where is the problem here?

body = "<html dir='rtl' lang='ar'>";

body += "<head>";

body += "<meta charset='UTF-8'>";

body += "<meta name='viewport' content='width=device-width, initial-scale=1.0'>";

body += "<link href='https://fonts.googleapis.com/css?family=Changa&amp;subset=arabic' rel='stylesheet' />";

body += "</head>";

body += "<body dir='rtl' lang='ar' style='font-family: Changa'>";

body += "<h1 style='font-family: Changa'>السلام عليكم " + App.getUserInfo("JafariaUserFirstName") + "</h1>";

body += "تم استلام الحجز التالي وسيتم الاتصال بكم لتأكيد الحجز:<br /><br />";

body += "<br /><br />";

body += "شكرا<br />";

body += "<br /><br />";

dubai.com</a>";

body += "</body>";

body += "</html>";

Thanks,

Jassim



error: Task could not find "lc.exe" using the SdkToolsPath "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\"

$
0
0

ErrorTask could not find "lc.exe"using the SdkToolsPath

"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\"

or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\NETFXSDK\4.7.2\WinSDK-NetFx40Tools-x86".

Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath

and that the Microsoft Windows SDK is installed Tenants

in my computer I see only the Folder 

C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools

I tried installing SDK 4.7.2 and this is the message I got:

"NET Framework 4.7.2 or a later update is already installed on this computer."

How can I solve this problem?


I have a pit frame that makes an AJAX call to an ASP page, however I am getting a 12031 error back.

$
0
0

I have a pit frame that hits a web page, that ends up gathering information and sending it off to an ASP page, where it stores that information into the database. This works for the majority of our customers; however, we have seen an increase number of clients that are getting back 12031. We were lucky enough to have customers willing enough to let us on their computer to try to fix this issue. What we have noticed when we install Fiddler on their system, the error goes away. We attempted to run the Pit Frame as an administrator, but this doesn't fix the issue. What am I missing?

Thank you in advance

On colude getting error in Entity Framework:Unable to load the specified metadata resource.

$
0
0

While loading project i am getting error "Unable to load the specified metadata resource."

connection string is <add name="SchoolEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=SQL5046.site4now.net;initial catalog=DB_A4D34D_School;persist security info=True;user id=DB_A4D34D_School_admin;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

If i make connectino with wizard it will be a tested scuccefully. What is the problem?


AccessVio

$
0
0

AccessViolationException when we try to access the IMAPI objects. This seems to be happen in few machines after windows update (August 13, 2019—KB4512501 (OS Build 17134.950)).

  1. Also it not only affect IMAPI it affect different places where Interop Marshaling is happening.
  2. Also we found AccessViolationException in our Reporting component. (LayoutManager.UpdatePageBreaks())
  3. UCMS IT service tool also crashing because of the same issue.

Currently we found it is happening in 4 machines after this KB update. Once we uninstall we don’t see this issue.

Attached call stack for various places.

Optical Drive:
_______________________
Application: syngo.DS.FE.Shell.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at System.Runtime.InteropServices.CustomMarshalers.EnumeratorViewOfEnumVariant.GetEnumVariant()
at System.Runtime.InteropServices.CustomMarshalers.EnumeratorViewOfEnumVariant.MoveNext()
at syngo.DS.FE.LocalMedia.OpticalDrive.OpticalDrives+<get_DeviceIds>d__8.MoveNext()
at System.Linq.Enumerable+WhereEnumerableIterator`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at syngo.DS.FE.LocalMedia.OpticalDrive.OpticalDrives.GetMediaRecorders(syngo.DS.FE.LocalMedia.OpticalDrive.DeviceType, System.Func`2<syngo.DS.FE.LocalMedia.OpticalDrive.IMediaRecorder,Boolean>)
at syngo.DS.FE.LocalMedia.ViewModels.CustomExportDialogViewModel.AvailableOpticalDrive()
at syngo.DS.FE.LocalMedia.ViewModels.CustomExportDialogViewModel.GetDvdList()
at System.Threading.Tasks.Task`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].InnerInvoke()
at System.Threading.Tasks.Task.Execute()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean)
at System.Threading.ThreadPoolWorkQueue.Dispatch()

Reporting:
________________________________________
Unhandled exception in Reporting: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at System.Runtime.InteropServices.CustomMarshalers.EnumeratorViewOfEnumVariant.GetEnumVariant()
at System.Runtime.InteropServices.CustomMarshalers.EnumeratorViewOfEnumVariant.MoveNext()
at KinetDx.CommonUtilities.HTMLUtilities.<GetAllVisibleHtmlElementsHelper>d__3.MoveNext() in d:\ProductFolder\Main\Report\Common\CommonUtilities\HTMLUtilities.cs:line 71
at KinetDx.CommonUtilities.HTMLUtilities.<GetAllVisibleHtmlElements>d__5.MoveNext() in d:\ProductFolder\Main\Report\Common\CommonUtilities\HTMLUtilities.cs:line 122
at KinetDx.Report.LayoutManager.ClearSectionsWithPageBreaks() in d:\ProductFolder\Main\Report\Report\LayoutManager.cs:line 514
at KinetDx.Report.LayoutManager.UpdatePageBreaks() in d:\ProductFolder\Main\Report\Report\LayoutManager.cs:line 557
________________________________________
UCMS:
________________________________________
Application: UCMS.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at System.Runtime.InteropServices.CustomMarshalers.EnumeratorViewOfEnumVariant.GetEnumVariant()
at System.Runtime.InteropServices.CustomMarshalers.EnumeratorViewOfEnumVariant.MoveNext()
at UCMS.Service.CoreService.ivuxpQUO3XdKwTtYrJh(System.Object)
at UCMS.Service.CoreService.O5NzMvBKX(Boolean, Boolean, Boolean)
at UCMS.Service.CoreService.IkxQYFCLr()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()


How to export sqlite data to Azure sql server for reporting

$
0
0

I have created a Xamarin.forms project as a stand alone project. What is the best way to export the data to Azure sql tables to create reports. I have attempted creating an Azure mobile service backend but having problems setting up the backend Tables. I wanted to use the Easy Tables approach but but cannot enable the Add button feature. Will appreciate your guidance.

Thanks

Alex.


akoranteng

Is .NET AES encrypt algorithm FIPS compatible?

$
0
0

In C# code, trying to encrypt the data in the system where FIPS is enabled.

internal byte[] MyKeyWrap(Aes aes)

       {

 

 byte[] keyData = this.protectedKeyData.GetPlaintext();

           try

           {

               return EncryptedXml.EncryptKey(keyData, aes);

           }

}

Error message:

This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.

Inner call trace:

 

  at System.Security.Cryptography.RijndaelManaged..ctor()

  at System.Security.Cryptography.Xml.SymmetricKeyWrap.AESKeyWrapEncrypt(Byte[] rgbKey, Byte[] rgbWrappedKeyData)

 

Enabled the FIPS in the Server 2016 with below details:

change this setting in Group Policy:

  1. Press Windows Key+R to open the Run dialog.
  2. Type “gpedit.msc” into the Run dialog box (without the quotes) and press Enter.
  3. Navigate to “Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options” in the Group Policy Editor.
  4. Locate the “System cryptography: Use FIPS compliant algorithms for encryption, hashing, and signing” setting in the right pane and double-click it.
  5. Set the setting to “Disabled” and click “OK.”
  6. Restart the computer.

Thanks, Harish

Viewing all 8156 articles
Browse latest View live


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