Hi,
Exception:
System.Printing Object reference not set to an instance of an object. at MS.Internal.PrintWin32Thunk.EnumDataThunkObject.GetPrintSystemValuesPerPrintQueues(PrintServer printServer, EnumeratedPrintQueueTypes[] flags, Queue`1 printObjectsCollection, String[] propertyFilter) at System.Printing.PrintQueueCollection..ctor(PrintServer printServer, String[] propertyFilter, EnumeratedPrintQueueTypes[] enumerationFlag)
It occurs when invoking:
vat x = printServer.GetPrintQueues(new[] { EnumeratedPrintQueueTypes.Local, EnumeratedPrintQueueTypes.Connections });
Any ideas, what is the reason and how best to fix?
NullReference in PrintQueueCollection
Data security over transit
Hi Guys,
A Winform client connects through .NET Remoting to Server components (C#), Currently looking for to enable data encryption in transit. from my search, I found that there are lot of recommendations to go for WCF but it is not possible to rewrite components
using WCF to leverage in built security features at the moment.
We referred the approach using SSPI but it seems an obsolete way and no other clear evidence/steps to follow it. It would be very helpful if you share any proven/current approach to encrypt/decrypt data when transfer from client to server through .NET remoting.
MsChart Axis X Minimum value being overridden to a lower value
Have been trying to solve this issue from some time now. The symptom is with the X axis I see that the value get overrided to a lower value from what I have set it at in Chart1.ChartAreas(0).AxisX.Minimum = Xmin (8.5 in this case) . However when I times the values by 100 the curve seems to center to a min and max. I am also not experiencing this with the Y axis at all. In the picture attached I am setting the min to 8.5 ( as seen where the curve starts in the picture. I also notice if I set the min below 8 it will let me set it to that. So this leads me to believe there is some sort of value that its overriding ratio to make the minimum inside of MSchart.
solution for Application: w3wp.exe Framework Version: v4.0.30319 Description: The process was terminated due to an internal error in the .NET Runtime at IP 6E870702 (6E7D0000) with exit code 80131506.
Event 1
Log Name: Application
Source: .NET Runtime
Event ID: 1023
Task Category: None
Level: Error
Keywords: Classic
Description:
Application: <var class="sbody-var"><Application name></var>
Framework Version: v4.0.21006
Description: The process was terminated due to an internal error in the .NET Runtime at IP 6B484BC2 (6B300000) with exit code 80131506.
Log Name: Application
Source: Application Error
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
Description:
Faulting application name: <var class="sbody-var"><Application name></var>, version: <var class="sbody-var"><Application Version></var>, time stamp: 0x4e11b8da
Faulting module name: clr.dll, version: 4.0.30319.235, time stamp: 0x4da4281c
Exception code: 0xc0000005
Fault offset: 0x0000000000037413
Faulting process id: 0x1b4c
Faulting application start time: 0x01cc3aed2d08224a
Faulting application path: <path>
Faulting module path: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Report Id: 0bdfb3f5-a6f9-11e0-acdb-0024e854572f
CAUSE
EntryWrittenEventHandler delivers large number of very old events
I have the following code which is using the "EntryWrittenEventHandler" class. It is running on thousands of machines very well. But in the last weeks I get a very strange behavior on more and more machines, where the EventHandler delivers a very
large number of very old events recursively. The "if part" of the code is executed (marked with "Unwanted Block") very rapidly. It happens on W2K12 and W2K12 R2 servers with up-to-date Framework 4 versions and probably
on other systems. I couldn't reproduce this problem in our test environment. What can I do to figure out the problem or to resolve it?
For the same Problem please also see link
http://stackoverflow.com/questions/16031610/strange-eventlog-behaviour-on-windows-server-2008-r2. There could be no answer found.
EventLog _EventLog_Sec = new EventLog("Security");
_EventLog_Sec.EntryWritten += new EntryWrittenEventHandler(OnEntryWritten_Sec);
_EventLog_Sec.EnableRaisingEvents = true;
public static void OnEntryWritten_Sec(object source, EntryWrittenEventArgs e)
{
try
{
//Damit keine alten Events gesendet werden
if(e.Entry.TimeGenerated < DateTime.Now - TimeSpan.FromMinutes(5))
{
...//Unwanted Block!!!
}
...
}
catch {}
}
copy file in folder (C#)
Hi! I have done the code below. The code is formed by three methods. The first method (browseDoc) browse for a file, and it saves the filename in a string variable called "file". The second method (browseFolder) works as the first method, but it saves the name of the selected folder in folderNa. The third method copys the selected file in the selected folder.
I have imported this library to ArchestrA in order to execute this code with Intouch. The problem is that the third method (uploadFile) only works when the selected file is a file from "C:\Program Files (x86)\Wonderware\InTouch" directory. When I select a file from another folder and this file is not in "C:\Program Files (x86)\Wonderware\InTouch" the third method does not works.
Does anyone know where is the problem? Thanks.
using System;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
public class CopyFiles
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
FolderBrowserDialog fold = new FolderBrowserDialog();
public string browseDoc(string file)
{
DialogResult result = openFileDialog1.ShowDialog();
if (result == DialogResult.OK)
{
file = Path.GetFileName( openFileDialog1.FileName);
return file;
}
else
{
return null;
}
}
public string browseFolder(string folderNa)
{
DialogResult result2 = fold.ShowDialog();
if (result2 == DialogResult.OK)
{
folderNa = (fold.SelectedPath);
return folderNa;
}
else
{
return null;
}
}
public void uploadFile(string DocName, string DirectoryName)
{
Directory.GetDirectories(DirectoryName);
string destination = Path.Combine(DirectoryName, Path.GetFileName(DocName));
File.Copy(DocName, destination);
MessageBox.Show(DocName + " copied in " + DirectoryName);
}
Universal Windows Platform - Unable to load dll sqlite3. the specified module could not be found. (exception from hresult 0x8007007e)
Hi,
I am running a universal app on an ARM device. On runtime it crashes with the above error. It worked fine a few days ago but recently it crashes with this error. I have the latest version of the nuget package SQLite.NET-PCL installed as well as the extension SQLite for Universal Windows Platform (3.12.2). I tried uninstalling and reinstalling the packages again but it still gives the same error. It runs fine on x64 but crashes on ARM or x86. Let me know how could I fix this issue.
Thank you
Free FingerPrint identification SDK
Dear all,
Is there Any free FingerPrint identification SDK Available in .net(c#) for any Fingerprint Access Control (any Brand)?
Thanks.
Unable to install MsmqDistributor
Hi,
I am getting below error while installing MsmqDistributor service:
C:\Program Files (x86)\Microsoft Visual Studio 14.0>installutil - "D:\Software\M
icrosoft\Enterprise Library\MsmqDistributor.exe"
Microsoft (R) .NET Framework Installation utility Version 4.6.1055.0
Copyright (C) Microsoft Corporation. All rights reserved.
Exception occurred while initializing the installation:
System.IO.FileLoadException: Could not load file or assembly 'file:///D:\Softwar
e\Microsoft\Enterprise Library\MsmqDistributor.exe' or one of its dependencies.
<g class="gr_ gr_78 gr-alert gr_gramm gr_run_anim Grammar multiReplace" data-gr-id="78" id="78">Operation</g> is not supported. (Exception from HRESULT: 0x80131515).
Please help me out on this issue. Attached is the source directory where <g class="gr_ gr_59 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="59" id="59">msmq</g> files are copied.
Thanks
Using ADAL against ADFS 3.0 for non-windows clients
Has anyone been able write a client based app (js, nodejs, xamarin etc) that runs on a mac or linux OS that can authenticate the user and acquire a token against ADFS?
I'm unable to write something that just passes the username and password, as I have MFA enabled and need the client to be interactive if MFA is enabled.
I've managed to do this okay with Powershell, but im struggling to get anything to work with a mac. So far all my attempts feel like ADAL only works against Azure AD for all the libraries, with the exception of the .net one.
Any help would be greatly appreciated.
Thanks
Mark Dordoy
Freezable vs Readonly Objects
I have a class to manage constants being used across the application like
public static class Constants
{
private Point p= new Point (10,10);
Public Point ABC { get { return p;}}
}
This property ABC is accessed across application numerous time. Read about Freezable , readonly, const keywords. Suggest which would be best choice for performance / memory save.
c sharp
Write a program to calculate (a+b)2 in c shsrp
Application created in .net 1.1.4322 for XP working in WIN 7. How does .net manage assemblies
I have an application that was originally built in .net 1.1.4322 and deployed on XP desktops. The application resides on the desktops and processes inputs via CTIOS (Computer telephony integration). Later, our company decided to move to windows 7 from windows XP, here is the issue; When we installed this application on the WIN 7 machine the application worked but with a few hick ups here and there but no major issues, since it has a refresh option, the user simply refreshed the application to get it going again but I later found that the relative path in "Hint path" is incorrect but it still works.
The WINNT in the path below is an XP specific path. WIN 7 uses another path to Microsoft.NET directory. Does .net rely on the reference name instead of the hint path or does it default to the most current .net version.
OS: Windows 7 enterprise edition
.Net versions installed, v1.1.4322, v2.0.50727, v4.0.30319
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "..\..\..\..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
Name = "System.Data"
AssemblyName = "System.Data"
HintPath = "..\..\..\..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
/>
<Reference
Name = "System.Drawing"
AssemblyName = "System.Drawing"
HintPath = "..\..\..\..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
/>
<Reference
Name = "System.Windows.Forms"
AssemblyName = "System.Windows.Forms"
HintPath = "..\..\..\..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Windows.Forms.dll"
/>
<Reference
Name = "System.XML"
AssemblyName = "System.Xml"
HintPath = "..\..\..\..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
/>
<Reference
Name = "NetCil"
AssemblyName = "NetCil"
HintPath = "NetCil.dll"
/>
<Reference
Name = "NetUtil"
AssemblyName = "NetUtil"
HintPath = "NetUtil.dll"
/>
</References>
</build>
Windows event log not being created, no exception
Running on a desktop I have the following code:
if(!EventLog.SourceExists("AutoTag"))EventLog.CreateEventSource("AutoTag","AutoTag");// Create an EventLog instance and assign its source.EventLog myLog =newEventLog();
myLog.Source="AutoTag";// Write an entry to the event log.
myLog.WriteEntry(msg,EventLogEntryType.Warning);
This works fine on all systems here but one. For that one no exception is thrown but the event log is not created.
Why?
What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing
Write a program to calculate formulae πr2 in c sharp
Write a program to calculate power of given number by user
WSANOTINITIALISED (10093) when calling BeginAcceptTcpClient()
Hi,
I have an .NET 3.5 application, which have a server socket. The connecting clients are handled using functions BeginAcceptTcpClient and EndAcceptTcpClient. Old version of the application have worked fine and served TCP clients without problems. But, now when the protocol an other socket connection that the application uses have changed, the server socket serves a few clients without error and then BeginAcceptTcpClient rises exception WSANOTINITIALISED (10093). The code of the server socket have not changed, and the changes in the the other socket connection is that it started using OpenSSL (new DLLs ssleay32.dll and libeay32.dll). The implementation of the protocol and the changes was made by an other company, and I don't have the source codes.
Detailed description of the exception is:
Successful WSAStartup not yet performed.
Either the application has not called WSAStartup or WSAStartup failed. The application may be accessing a socket that the current active task does not own (that is, trying to share a socket between tasks), or WSACleanup has been called too many times.
But, our application code doesn't have any WSAStartup or WSACleanup calls.
Stack Trace when the exception occurs:
System.Net.Sockets.SocketException: Either the application has not called WSAStartup, or WSAStartup failed
at System.Net.Sockets.Socket..ctor(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
at System.Net.Sockets.Socket.DoBeginAccept(Socket acceptSocket, Int32 receiveSize, AcceptOverlappedAsyncResult asyncResult)
at System.Net.Sockets.Socket.BeginAccept(Socket acceptSocket, Int32 receiveSize, AsyncCallback callback, Object state)
at System.Net.Sockets.Socket.BeginAccept(AsyncCallback callback, Object state)
at System.Net.Sockets.TcpListener.BeginAcceptTcpClient(AsyncCallback callback, Object state)
So, what could corrupt the sever socket that way? Has anybody seen this kind server socket malfunction before? Is there some good way to trace WSACleanup calls, if those cause the problem?
How to update group policy of domain user using IGroupPolicyObject?
i am writing a program to update the group policies of the user for windows 10. I am able to update the local group policies of users in a workgroup using the IGroupPolicyObject2.OpenLocalMachineGPOForPrincipal(). But the same method will not work for domain users, in addition to that it causes a exception. I understand that in a workgroup, the group polices are stored locally and when in a domain it is stored in domain controller.
So to update the group policy i tried IGroupPolicyObject.OpenDSGPO(). It accepts 2 parameters- path and flag. The first parameter i passed "domain1/Users/user1" where "domain1" is the name of the domain, user1 is the domain user name. But i face an exception: "Value does not fall in the expected range"
Please suggest a way to update the group policy for the domain user using IGroupPolicyObject?
Note: i am aware of powershell to update the group policy but i am not going into it, since i am already using IGroupPolicyObject2.
Is there any forums for bot frame work?
Hi,
I am developing one Bot frame work application in that i want to get the user current location details for this i am using the Geolocation Class when i am using this class i am not able to add the class reference directly and when i am adding the external dll its showing some error is there any possibility to get the user current location in Bots.
Finally is there any forums for Bots frame work.
Thanks in advance
Unable to install .NET
Hi,
I am trying to install .NET on Windows 7 Professional 64bit but getting:
Blocking Issues: The setup cannot run in compatibility mode. The .NET Framework 4.6.1 is not supported on this operating system.
I tried all version and all of them giving the same problem.
Can anyone help please...
Thanks,