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

EWS, EWS proxy and Graph

$
0
0

Hi all,

I'm looking for more information on these API's. Just a few questions about them and how we are using EWS.

In our Web References folder of our web application it appears that we have a reference to the EWS proxy library. Is that library designed to work with exchange via a proxy server?

If so, I'm looking into possibly getting rid of that API and going with EWS or Graph. Currently our application reaches out to our onsite exchange server via URL. It sets up an exchange service binding then we check for emails, and process them into a database. This is some old code and it hangs every time the email contains an inline image(like a picture in the signature), then we manually remove it and resend it.

I'd like to bring this code up to date and process the emails differently. Is Graph an updated API that can handle this or do I need to stick with EWS? 



"Safe" to use System.Diagnostics.Trace.CorrelationManager.ActivityId in production?

$
0
0

We have a REST API that calls stored procedures to perform various tasks.

We need to track and log which stored procedures are called as a result of individual REST API HTTP requests (may be multiple). 

For simplicity we are considering setting System.Diagnostics.Trace.CorrelationManager.ActivityId = Guid.NewGuid() in the REST API Controller when every request is received (in a "filter") and then picking it up again just before calling the stored procedures and including it as a parameter. This way we don't need to include the guid as a parameter in every single method call in every layer of the server. 

Is it "safe" to use System.Diagnostics.Trace.CorrelationManager.ActivityId like this in production? E.g. it can't be "switched off" by accident somehow in the target environment? 

Any other performance, security or multi threading issues worth considering by doing it like this? 

Our REST API runs self hosted as a Windows Service. We are using .NET Framework 4.6.1. 

SignalR Logging no time

$
0
0
I entered the script in the 

<system.diagnostics>

section of the service config file which is supposed to produce an init log and a transports log.  It is producing a transports log but there are no timestamps which would be helpful in troubleshooting the problem we're having with the client and service loosing connection with each over overnight. 

Anyone know how to record times similar to event logs in this transport file?

the original article with the script is here https://docs.microsoft.com/en-us/aspnet/signalr/overview/testing-and-debugging/enabling-signalr-tracing

TIA

Harry

Need to support SVG in C#

$
0
0

Hello All,

I would like to draw the graphics in SVG format. And also it would be exportable as XML file. Please help me which .net framework classes will help me to do.

Please find the attached image for reference.

Best Regards,

Hari


click "Proposed As Answer by" if this post solves your problem or "Vote As Helpful" if a post has been useful to you Happy Programming! Hari


Where to download the Speech SDK 5.4 Language Package?

$
0
0

Exception happens for following code, which I'd like to get voice with Chinese. I guess I need install the Speech SDK 5.4 Language Package, where to download it?

voice.Voice=voice.GetVoices(string.Empty, strint Empty).Item(3);

Running .Net exe from windows scheduler to generate the PDF files using Reportviewer and intermittently getting below error

$
0
0
Timed out waiting for a program to execute. The command being executed was "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\vbc.exe" /noconfig @"C:\Windows\TEMP\5iabw1hv.cmdline".    at System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine)
   at System.CodeDom.Compiler.Executor.ExecWaitWithCapture(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine)
   at System.CodeDom.Compiler.CodeCompiler.Compile(CompilerParameters options, String compilerDirectory, String compilerExe, String arguments, String& outputFile, Int32& nativeReturnValue, String trueArgs)
   at Microsoft.VisualBasic.VBCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames)
   at System.CodeDom.Compiler.CodeCompiler.FromDomBatch(CompilerParameters options, CodeCompileUnit[] ea)
   at System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromDomBatch(CompilerParameters options, CodeCompileUnit[] ea)
   at Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler.InternalCompile(AppDomain compilationTempAppDomain, Boolean refusePermissions)
   at Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler.<>c__DisplayClass2.<Compile>b__0()
   at Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.<>c__DisplayClass1.<Run>b__0(Object state)
   at System.Security.SecurityContext.Run(SecurityContext securityContext, ContextCallback callback, Object state)
   at Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.Run(ContextBody callback)
   at Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler.Compile(IExpressionHostAssemblyHolder expressionHostAssemblyHolder, AppDomain compilationTempAppDomain, Boolean refusePermissions, PublishingVersioning versioning)
   at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.Phase3(ParameterInfoCollection& parameters, Dictionary`2& groupingExprCountAtScope)
   at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.InternalCreateIntermediateFormat(Stream definitionStream, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash)
   at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CompileOdpReport(PublishingContext reportPublishingContext, IDataProtection dataProtection, PublishingErrorContext errorContext, String& reportDescription, String& reportLanguage, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash)
   at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext, IDataProtection dataProtection) Int32 ExecWaitWithCaptureUnimpersonated(Microsoft.Win32.SafeHandles.SafeUserTokenHandle, System.String, System.String, System.CodeDom.Compiler.TempFileCollection, System.String ByRef, System.String ByRef, System.String)
   
   Error in DocumentGenerationOnlineService-RenderReportData()
   
   Timed out waiting for a program to execute. The command being executed was "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\vbc.exe" /noconfig @"C:\Windows\TEMP\5iabw1hv.cmdline".    at SCIF.PM.DocumentGeneration.DocumentGenerationOnlineService.RenderReportData(IEnumerable`1 documentData)
   at SCIF.PM.DocumentGeneration.DocumentGenerationOnlineService.GenerateReport(IEnumerable`1 source) Byte[] RenderReportData(System.Collections.Generic.IEnumerable`1[SCIF.PM.Domain.DTO.DocumentDTO.IPolicyDocument])

Question for Independent Contractors

$
0
0
I have been tasked to locate Independent contractors with Network Admin skills, specifically Microsoft tool sets - maybe even some application developmment (can get more details).  Where do those of you that are IC go to find postings? What sites are people using? THANKS!

How to evaluate column expressions without DataTables

$
0
0

Hi,

I’m looking for a way to evaluate the column Expression available in ADO.NET … without using a DataTable instance.

Say I have a column expression like iif(a > b, true, false)

Is there a way to evaluate this expression by passing somehow values for a and b?

I looked at the  Compute method on DataTable but it is not quite what I’m looking for:

object result1 = new DataTable().Compute("20.0 / 2", null);

object result3 = new DataTable().Compute("iif(10 > 5, true, false)", null);

object result2 = new DataTable().Compute("iif(a > b, true, false)", null); -- how to evaluate this

Idea behind this is to move away from DataTable to simple array structure for performance reason.

Still I need to support a way to generate the legacy expression used.

I would rather avoid building the expression string to generate this as it will be poor performance for large number of rows.

Thanks in advance for your help

Nick



extern structure not get value

$
0
0

Hi I have plugin.h and plugin.c

in the header I define this :

extern PLUG_CB_CREATEPROCESS* process_Info;

in the body :

PLUG_CB_CREATEPROCESS* process_Info ;

extern "C" __declspec(dllexport) void CBCREATEPROCESS(CBTYPE cbType,PLUG_CB_CREATEPROCESS* info)
{
	//process_Info = new (PLUG_CB_CREATEPROCESS);
	process_Info = info;
}

where PLUG_CB_CREATEPROCESS a strcutre from another header file

typedef struct
{
    CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo;
    IMAGEHLP_MODULE64* modInfo;
    const char* DebugFileName;
    PROCESS_INFORMATION* fdProcessInfo;
} PLUG_CB_CREATEPROCESS;

now I try to get this <g class="gr_ gr_225 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="225" id="225">strcture</g> from another c++ file ( memory.cpp)

numBytes = VirtualQueryEx(process_Info->fdProcessInfo->hProcess, (LPVOID)pageStart, &mbi, sizeof(mbi));
here I got info in this <g class="gr_ gr_379 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="379" id="379">strctureare</g> <g class="gr_ gr_388 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="388" id="388">diffrent</g> from the one it assigned at <g class="gr_ gr_594 gr-alert gr_gramm gr_inline_cards gr_run_anim Style multiReplace" data-gr-id="594" id="594">line  </g>
process_Info = info;
<g class="gr_ gr_594 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Style multiReplace" data-gr-id="594" id="594">anybody</g> <g class="gr_ gr_595 gr-alert gr_gramm gr_inline_cards gr_run_anim Style multiReplace" data-gr-id="595" id="595">know  why</g> this <g class="gr_ gr_572 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Grammar multiReplace" data-gr-id="572" id="572">happen</g>!!

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

 

Problem importing a dll in NAV

$
0
0

Hi everyone,

I've got an issue with a dll from a printer development environment. The issue is that I need to send some files to prinet to a certain printer, and I found that there's a development dll available for that printer. That printer wasn't singed, it didn't have the public token.

I found a post, and signed this way:

1- Using the Visual Studio 2015 command prompt

2- sn -k tsclibnet.snk

3-ildasm tsclibnet.dll /out:tsclibnet.il

4-ilasm tsclibnet.il /res:tsclibnet.res /dll /key:tsclibnet.snk /out:tsclibnet.dll

5-Found that process ended correct with sn -vf tsclibnet.dll

But when importing the DLL into a dotnet object in navision, I still having this problem:

Am I doing something wrong with the signing? Should I sign it with another application?


How i can get the list of all web sites that has been added in compatibility mode using c#?

$
0
0

Hi Experts,

I want to fetch the list of all websites that has been added in compatibility view setting in Internet explorer.

Is it possible to get that list using c#?

 If yes then how ?

Thanks

Praveen


ManualResetEvent.WaitOne throws System.AccessViolationException

$
0
0

We have a multi-threaded application that receives events from a device that unlocks a worker thread.

When we receive an event, EventWaitHandle.Set() is called to unlock the worker thread and then goes back to waiting for other hardware events.  

Before the WaitOne can return in the worker thread the following error is recorded in the dump file.

System.AccessViolationException   Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

I can not figure out why this is happening.  Thread 26 comes from a 3rd party library, and is back waiting by the time the crash occurs.

This is a mixed native/.Net 4.6 C++ app.  I'd be thankful for any help.

Thread 49 is waiting, thread 26 is setting the event and then going back to sleep.

In exe.5788.dmp the Module C:\Windows\System32\KERNELBASE.dll has caused an access violation exception (0xC0000005) when trying to execute instructions from a non-executable address at memory location 0x00000000 on thread 49

Thread 49 - System ID 2628

Entry point  clr!Thread::intermediateThreadProc
Create time  10/31/2018 12:07:21 PM
Time spent in user mode  0 Days 00:00:00.015
Time spent in kernel mode  0 Days 00:00:00.015


This thread is not fully resolved and may or may not be a problem. Further analysis of these threads may be required.

The thread has evidence of .net exceptions on the stack. Check the Previous .NET Exceptions Report (Exceptions in all .NET Thread Stacks) to view more details of the associated exception
.NET Call Stack
[[GCFrame]]
[[DebuggerU2MCatchHandlerFrame]]

Full Call Stack
ntdll!NtWaitForMultipleObjects+c
KERNELBASE!WaitForMultipleObjectsEx+cc
kernel32!WaitForMultipleObjects+19
kernel32!WerpReportFaultInternal+50b
kernel32!WerpReportFault+74
KERNELBASE!UnhandledExceptionFilter+1f4
ntdll!__RtlUserThreadStart+54554
[[GCFrame]]
[[DebuggerU2MCatchHandlerFrame]]
ntdll!_RtlUserThreadStart+1b

Thread 26 - System ID 5008

Entry point  msvcr80!_threadstart
Create time  10/31/2018 12:07:16 PM
Time spent in user mode  0 Days 00:00:00.000
Time spent in kernel mode  0 Days 00:00:00.000


This thread is waiting in a WaitOne
.NET Call Stack
[[HelperMethodFrame_1OBJ] (System.Threading.WaitHandle.WaitOneNative)] System.Threading.WaitHandle.WaitOneNative(System.Runtime.InteropServices.SafeHandle, UInt32, Boolean, Boolean)
mscorlib_ni!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle, Int64, Boolean, Boolean)+21
mscorlib_ni!System.Threading.WaitHandle.WaitOne(Int32, Boolean)+28
mscorlib_ni!System.Threading.WaitHandle.WaitOne()+12
ACIDialogic.Dialogic.ccHandler()+897
.ACIDialogic.cc_handler(UInt32)+6

Full Call Stack
ntdll!NtWaitForMultipleObjects+c
KERNELBASE!WaitForMultipleObjectsEx+cc
clr!WaitForMultipleObjectsEx_SO_TOLERANT+3c
clr!Thread::DoAppropriateWaitWorker+237
clr!Thread::DoAppropriateWait+64
clr!WaitHandleNative::CorWaitOneNative+163
[[HelperMethodFrame_1OBJ] (System.Threading.WaitHandle.WaitOneNative)] System.Threading.WaitHandle.WaitOneNative(System.Runtime.InteropServices.SafeHandle, UInt32, Boolean, Boolean)
mscorlib_ni!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle, Int64, Boolean, Boolean)+21
mscorlib_ni!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle, Int64, Boolean, Boolean)+21
mscorlib_ni!System.Threading.WaitHandle.WaitOne(Int32, Boolean)+28
mscorlib_ni!System.Threading.WaitHandle.WaitOne(Int32, Boolean)+28
mscorlib_ni!System.Threading.WaitHandle.WaitOne()+12
mscorlib_ni!System.Threading.WaitHandle.WaitOne()+12
ACIDialogic.Dialogic.ccHandler()+897
librtfmt!RtfRegisterClient+692
<Module>.ACIDialogic.cc_handler(UInt32)+6
clr!IJWNOADThunkJumpTarget+15
libsrlmt!sr_relseall+2b2
libsrlmt!sr_waitevt+15f
libsrlmt!sr_enbhiprihdlr+107
msvcr80!_callthreadstart+1b
msvcr80!_threadstart+5a
ntdll!__RtlUserThreadStart+2f
ntdll!_RtlUserThreadStart+1b

app.manifest - turn on all operating systems?

$
0
0

Hi all;

We have created an app.manifest to turn on high-res processing. We run well on all versions of Windows. Should we uncomment the settings for each version? Or as we run on all, leave it commented so if there's a newer version of Windows we still run fine.

??? - thanks - dave


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

System.Web.HttpFileCollectionWrapper - An odd beast - Enumerator exhibits weird behavior, not conventional, opinions?

$
0
0

The "System.Web.HttpFileCollectionWrapper" .NET Framework type implements System.Collections.IEnumerable so I've tried enumerating over an instance of it using a foreach() construct as follows:

foreach(var X in this.Request.Files) {

    // do something with object in collection

}

This enumerator returns just a key (System.String) in the collection and if a user sends multiple files using a single HTML input element of type file, all the keys are the same.

However, the indexer returns the appropriate objects one would expect to be getting from the enumerator. Which is a System.Web.HttpPostedFileWrapper for each file sent up by the user.

Does anyone besides myself think this is just weird? Obviously, it can be done programatically but from an intuitive perspective about what a programmer expects to get back when enumerating through the type I can't help but be baffled by the behavior personally.

Thoughts please? Thanks in advance!


Encryption and hash checksum on Files

$
0
0

Dear All,

I am looking to implement Encryption and Hash check sum on some of our files. We use SSIS packages to generate these files, however I am open to using C# for the implementation using script task.

Could you please help me in:

> Best ways of Implementing these in C#

> Industry standards for Encryption & hashing algorithms.

Thanks.

Microsoft.GroupPolicy ComputerConfiguration Class

$
0
0

Good day,

I am hoping to put together a POC in our AD test environment using the Microsoft.GroupPolicy namespace for checking individual machine's computer configurations.

There is a heap load of documentation on user configuration in general through C#, but this particular namespace doesn't seem to shed any light on its functionality at all:

https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.grouppolicy.computerconfiguration(v=vs.85).aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1

I'm not sure if I'm just searching for the wrong language, and apologize in advanced if this a duplicate question.

If anyone knows whether or not this would be a viable solution, and if so, could share some examples or more thorough documentation on the matter, I would be greatly appreciated!

Thanks so much for your time!

How i can get the list of all web sites that has been added in compatibility mode using c#?

$
0
0

Hi Experts,

I want to fetch the list of all websites that has been added in compatibility view setting in Internet explorer.

Is it possible to get that list using c#?

 If yes then how ?

Thanks

Praveen


.NET app.manifest - should I set the assemblyIdentity?

$
0
0

Hi all;

If I understand this right, the <assembly manifestVersion="1.0" part in an app.manifest is left alone.

But what about <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>? Should that be changed to match the name and version number of my application?

thanks - dave


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

Cannot add C# .NET4.6.2 project as a reference of C++ project

$
0
0

Hi,

Our company used to use VS2010 to build a C++ project that referenced a C# project that target .NET 4.0 framework.  Everything seems to work fine.

Then we decided to move to VS2015 professional and latest .NET framework. Solution seems to be converted properly, however, when I tried to change the C# project to target .NET4.6.2, the C++ project that referenced it start to complain about cannot use any helper function from that C# reference.  Then I tried to remove and re-add the project, and I got the following error.

    One or more error occurred.

    A referenced to <project> cannot be added because it is incompatible with this project.

The C++ project default using:

Target Platform Version: 8.1

Platform Toolset: Visual Studio 2015 (v140)

I've changed Target Platform to 10.0.14393.0.  Problem still exist.

Then I tried to change the C# project to target .NET 4.6 or 4.5, I still can't add the project to the C++ project until I change it back to .NET 4 then it allows me to add.

Any help would be appreciated.

Thanks,

Gary

Viewing all 8156 articles
Browse latest View live


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