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

GDI+ measured font size is mismatched while comparing with Windows 7 and other operating system for `Cambria Math` font.

$
0
0

Hi Team,

It would be great if you can resolve my problem.

The font size value is mismatched while comparing with Windows 7 and other operating system for `Cambria Math` font by using `graphics. MeasureString` API.

Issue reproducing code snippet:

char c = '\u23A1';
string text = c.ToString();
System.Drawing.Font font = new System.Drawing.Font("Cambria Math", 8, FontStyle.Regular);
StringFormat format = new StringFormat(StringFormat.GenericTypographic);
//Remove the linelimit flag from create stringformat object.
//The behavior of the linelimit flag is “only entire lines are laid out in the formatting rectangle”, 
//By default layout continues until the end of the text, or until no more lines are visible as a result of clipping”.
format.FormatFlags &= ~StringFormatFlags.LineLimit;
format.FormatFlags |= StringFormatFlags.MeasureTrailingSpaces;
format.FormatFlags |= StringFormatFlags.NoClip;
format.Trimming = StringTrimming.Word;
SizeF size = new SizeF();

Bitmap bitmap = new Bitmap(400, 200);
Graphics graphics = Graphics.FromImage(bitmap);
size.Height = graphics.MeasureString(text[0].ToString(), font, new PointF(0, 0), format).Height;

Please find different values in the following table.

Operating system

Font Height

Windows 10

10.666666

Windows 7

59.52083


Could you please let me know the reason for this and what we have to do to retrieve the same font height in all operating systems. 

Please let me know if you have any other concerns.

Thanks,

Sivasubramani. 


Does Guid.NewGuid() produce UUID version 4 according to RFC4122?

$
0
0
The .NET Framework’s 4.0 Guid.NewGuid() method, what kind of GUID does it produce?
Does it produce UUID version 4 according to standard RFC4122?

Business Classes for Swift and .Net Web Applications

$
0
0

I want to create business classes and use in the same ones in both a mobile Swift based application and .NET web application using C#.  How do I create them once using C# and use them in both the mobile Swift Application and the .NET web application?  


How to convert .eml to .msg?

$
0
0

I have been using Windows live mail to receive my emails. All the downloaded emails are in .eml format.

Now i want to configure my mailbox in Outlook 2010 but the mailbox export tool in windows live mail doesn't export the header information.

Is there any way i move my .eml message to outlook 2010 .msg format with complete header information?

The unit test adapter failed to connect to the data source or to read the data. For more information on troubleshooting this error, see "Troubleshooting Data-Driven Unit Tests"

$
0
0

The unit test adapter failed to connect to the data source or to read the data. For more information on troubleshooting this error, see "Troubleshooting Data-Driven Unit Tests" 

After i migrated from VS2015 to VS 2017

What is equivalent option of -res: of CSC compiler in Visual Studio csproj file

$
0
0

My project has .resources and .cs files.Using command line "csc" i can compile cs files and resources into one library using the following command: csc -res:Message s.de.resources -res:Messages.es.resources -res:Messages.resources Clas s1.cs /target:library

But how do i achieve the same using csproj file.If i use visual studio to compile,there are two file properties"EmbeddedResource" & "Resource". "EmbeddedResource" generates separate satellite assembly for each of the resources file and if compiled using "resource" option the resources are not accessible using ResourceManager class.I want all my .resources file and the cs files to be compiled into one library.

Crashes in .NET 2.0/4.0 applications after Windows 10 update 1803

$
0
0

Hi,

We are getting customer reports of crashes of our C# WinForm .NET 2.0/4.0 apps. All of these crashes started happening right after the update 1803 is installed.

I have a crash dump which shows a stacktrace not resolved to any of our app code:

Unhandled exception at 0x6A114E62 (System.Xml.ni.dll) in rt.exe_180620_140855.dmp: 0xC0000005: Access violation writing location 0xDC492895.

System.Xml.ni.dll!6a114e62()
crypt32.dll!_TlgEnableCallback()
ntdll.dll!_TpplopCallbackEpilog@4()

From WER logs:

Sig[0].Name=Application Name

Sig[0].Value=rt.exe
Sig[1].Name=Application Version
Sig[1].Value=1.0.6696.27112
Sig[2].Name=Application Timestamp
Sig[2].Value=5aea19a1
Sig[3].Name=Fault Module Name
Sig[3].Value=combase.dll
Sig[4].Name=Fault Module Version
Sig[4].Value=6.2.17134.112
Sig[5].Name=Fault Module Timestamp
Sig[5].Value=cdc43ef4
Sig[6].Name=Exception Code
Sig[6].Value=c000001d
Sig[7].Name=Exception Offset
Sig[7].Value=00004a9d

Another:

Sig[0].Name=Application Name
Sig[0].Value=rt.exe
Sig[1].Name=Application Version
Sig[1].Value=1.0.6649.30548
Sig[2].Name=Application Timestamp
Sig[2].Value=5aac3df8
Sig[3].Name=Fault Module Name
Sig[3].Value=unknown
Sig[4].Name=Fault Module Version
Sig[4].Value=0.0.0.0
Sig[5].Name=Fault Module Timestamp
Sig[5].Value=00000000
Sig[6].Name=Exception Code
Sig[6].Value=c0000005
Sig[7].Name=Exception Offset
Sig[7].Value=000000b4

The faulting module is either unknown or combase.dll or crypt32.dll. Our apps are targeted to .NET 3.5 and targeting to .NET 4.0 made no change. The only thing that is common among these crashes is it all started after an update to 1803. But I could not find any .NET specific changes in this update.

Any idea what is causing these crashes?


Getting error while deploying logic app from Visual Studio 2017 Professional

$
0
0

Hi,

I am getting below error while deploying the logic app from VS 2017 Professional.

"Microsoft.VisualStudio.Shell.Interop". Error: Type 'SVsSolutionObject' and type 'SVsSolution' both have the same UUID. "

This error is showing for the first time, and next time onwards it is showing below one.

"Unspecified error - Exception from HRESULT - 0x800004005"


Does Guid.NewGuid() produce UUID version 4 according to RFC4122?

$
0
0
The .NET Framework’s 4.0 Guid.NewGuid() method, what kind of GUID does it produce?
Does it produce UUID version 4 according to standard RFC4122?

Service OnStop - how much time? what's happening?

$
0
0
Hi,

I'm trying to write a service in C#.  I've got it running and installed, but I have two questions...

1. When the SCM starts and stops a service, does it always start and stop an entire process and CLR?  Or might it keep the Service object in memory, and call OnStart() multiple times on the same object if you restart the service.

2. I can't find docs that explain what exactly happens around the call to OnStop(). Specifically, does it have to run in a certain amount of time?  And after OnStop returns, are threads in the service allowed to finish gracefully and cleanup, or is the SCM going to kill them?   I ask because let's imagine I have a mail server, and a client might be in the middle of uploading a 5 MB email.  I would like the worker thread handling that interaction to shutdown gracefully.   Is there a way to do that?

thanks,
Rob

Win32.SetParent( hWndChild, hWndNewParent ) not working as expected after office update

$
0
0
After updating Office 365 to Build 1808, one of my office add-in control doesn't sit on outlook window. Rather it sits on the desktop. I did some research, looks like Win32 call SetParent(   HWND hWndChild,   HWND hWndNewParent ) is not working as expected. Any help would be really appreciated

Search Active Directory where the UPN contains numbers?

$
0
0

Right now I have the following search.fiter but it would be nice if I could get my search to return any results where there is a combination of numbers. I have noticed a few accounts in AD that have UPNs that are not correctly configured e.g. BB434343@domain.com. I want to find all of those that have numbers in them. There will be cases where there should be a number such as batty.boy1@domain.com.  So I'm thinking a something like in sql where you can query the value that contains more than 1 number.  so bob1 would return but bob11 would

Im stumped on this, hoping for help!

search.Filter = "(&(objectClass=User) (userPrincipalName=*" + username + "*))";''

Cheers

enforcement

$
0
0

i hope everyone at microsoft watches every one they love burn

excessive use comctl32.dll with .net framework 4.x under win10

$
0
0

With processmonitor we traced a winforms application using comctl32.dll. Under Win7 with Framework 4.x the application starts fast an there is a normal using of comctl32.dll. Unter win10 with framework 4.x the same applikation start two oder three times slower. Reason is the excessive use comctl32.dll, which we see with the processmonitor.

Problem seems the function in Framework 4.x with win10 GetModuleHandle("comctl32.dll")

Details:
https://stackoverflow.com/questions/39673069/windows-10-exessive-use-of-comctl32-dll-in-net-4-0-and-up

How to convert .pst to .msg

$
0
0

Hi

Can anybody help me out find a solution for conversion of .pst file to .msg files

 

thanks & regards

KB

 


Test09172018

$
0
0
Test Post will be deleted.

Shekhar

WebRequest FTP

$
0
0

FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://MyFTPServer.tld");
request.Credentials = new NetworkCredential(user, password);
request.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
FtpWebResponse response = (FtpWebResponse)request.GetResponse();

throws a System.Net.WebException (Unable to connect to the remote server) after 20 sec. if server is not running.
The mentioned exception is documented as something about EnableSsl and server not supporting this, but the behaviour is more like a timeout (which is natural of course, server is not running), how to control this timeout?


CheckSignature on some SAML responses fails.

$
0
0

Hi Team,

We have implemented SAML authentication and using .Net framework 4.6.2

CheckSignature is failing on some SAML responses, so far we have found one such case. CheckSignature passes for all other SAML responses.

1. SAML response is valid

2. Certificate is valid

3. SAML response text was not altered.

Found this article on the web --> https://github.com/dotnet/corefx/issues/19198

Here is the code which checks signature on SAML response.

 XmlNamespaceManager manager = new XmlNamespaceManager(xmlDoc.NameTable);
            manager.AddNamespace("ds", SignedXml.XmlDsigNamespaceUrl);
            manager.AddNamespace("saml", "urn:oasis:names:tc:SAML:2.0:assertion");
            manager.AddNamespace("samlp", "urn:oasis:names:tc:SAML:2.0:protocol");

            XmlNodeList nodeList = xmlDoc.SelectNodes("//ds:Signature", manager);

            SignedXml signedXml = new SignedXml(xmlDoc);

            if (nodeList?.Count != 1)
            {
                return false;
            }

            //Load signedXml from SAML Response 

            signedXml.LoadXml((XmlElement) nodeList[0]);

            // Load certificate from file store
            X509Certificate2 cert = (certificate from file store.)

            //Verifiy signature using the public key in the signature and key signing ceritificate.

            return (signedXml.CheckSignature() || signedXml.CheckSignature(cert, true));

Please let me know, if there I am missing anything here.

regards,

Prashant.

How do I implement Dispose() on a TreeView inherited class?

$
0
0

Hi all;

The Windows Forms TreeView control has a Dispose() method. But a sub-class can't override it.

How can I dispose of objects (Brushes & Pens) when the object is no longer in use? I don't want to have to have the parent Control responsible for calling it because sooner or later one of the developers using this will forgot that call.

thanks - dave


What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

FileSystemWatcher Deleted event

$
0
0

I have learned the hard way that deleting a file in Windows does not necessarily mean that the file gets deleted right away, it will just be marked for deletion until the last handle to the file is closed.

When does FileSystemWatcher raise Deleted event?

Viewing all 8156 articles
Browse latest View live


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