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

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

$
0
0

I tried to insert one table data to another table using storedprocedure. 80% records are inserted to the table but finally i got an error

Unhandled Exception: System.AccessViolationException:


Problem with DataContext, after uninstalling VMWare Horizon Client v3.x

$
0
0

Hi everyone,

This is a particularly critical problem in our company.

Our company had installed VMWare Horizon Client v3.2.0 on our users laptops.  When this wasuninstalled, or upgraded to a later version, none of our "fat-Client" applications which accessed SQL Server would work properly anymore.   Once this was uninstalled, the first time any of our .Net applications attempted to connect to any SQL Server server or database, there would be an 800-second delay before anything happened.  

It would always freeze on the following line, even if your connection string was complete rubbish "Data Source=MikeNeedsABeer".   Nothing would happen for 800 seconds, andthen an error would occur.

MikesDataContext dc = new MikesDataContext();

Once this 800-second delay had happened once, from then on, you could connect (almost) immediately, change the connection string and connect to other servers or databases, absolutely no problem.  

There would always be this 800-second delay the first time we open any DataContext.  I even knocked up a dumb WinForms app, where you could enter a connection string, and hit a Connect button  (partly to strip this issue down to just 9 lines of code, and partly to prove that this wasn't caused by a faulty app.config or web.config file).

But - here's the kicker - this only happens if:

  • you have uninstalled VMWare Horizon Client v3.x and rebooted afterwards
  • your user doesn't have Local Admin rights on that laptop.

So, if you give your user Local Admin rights - the problem goes away.  Every connection is as fast as before.

This second part is the most confusing.  This hints that this must be a permissions problem (which didn't existbefore before uninstalling the VMWare software)  but it disappears when the user has more rights.  

Our apps use .Net Framework 4.x, but VMWare Horizon Client used .Net Framework 2.0.  Is this related ?

Can anyone give me any help, how I can find a solution to this ?

Basically, we had this VMWare software on all of our company laptops, and, one by one, as the laptops have been upgraded, each of our WinForms or Excel VSTO applications, has hit this issue.   So suddenly, our users can't/won't use our in-house Addins, as they have to wait 13min 40sec before they finish that first database connection.

And, like I said, it's this one line of code which "goes into a coma" for 800-seconds, regardless of the connection string which is passed to it.

MikesDataContext dc = new MikesDataContext();

No exceptions occur, this line just hangs.

This is a critical issue for us, and we're stuck !

More details of the problem here:

StackOverflow article

Best regards,

Mike Gledhill

Partner Reinsurance

Zurich


POS - Using Blackcopper BC-85AC thermal Receipt Printer

$
0
0

Hey I am facing a little issue while accessing the POS printer I have configure it and send the Test Print It all working fine but when i tried to access it with the posExplorer.GetDevice(); I get Null value.
and I have tried of adding the logical Name my command line but every time I get this two error.
One is " POS -  No device is Found on this port  ".
Second is " POS - NO device of this Name"

help Me out Please its really Urgent

CS00012 IEnumerable Not available in .NET Framework 4.5.1, 4.5.2, 4.6, 4.6.1

$
0
0

Why is IEnumerable in the System.Linq assembly not available in .NET 4.5.1 and above? I would think the System.Linq assembly would be part of the standard libraries for new .NET libraries.  Especially as useful as LINQ is with everything; I mean, I can't make an application without LINQ. 

I am just going to recreate the class myself so that they do work. I just figure this is a question that seriously need asked about.


MSDN jbeen19

If you want to attempt how I ran into this error, just create a new project->Visual C#->Web->Class Library (Package) than copy all of AspNet.Identity over once your done will all the little error you are stuck with IEnumerable<> is not available in .Net Framework 4.5.1, which is complaining about every method who's variable's data type is IEnumerable<>.


Microsoft.NET Framework Error: Unhandled Exception

$
0
0

Please see the following error message (below the dash-line). I am "thinking" this means I need to remove the TeamViewerMeetingAddIn.AddIn.DoStartup() - But not sure if I am missing something.  Has anyone seen this before?

Thank you,

Melissa

---------------------------------------------------------------------------------------------------------------------------

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.Runtime.InteropServices.COMException (0x8004010F): The attempted operation failed. An object could not be found.

   at Microsoft.Office.Interop.Outlook.NameSpaceClass.GetDefaultFolder(OlDefaultFolders FolderType)

   at TeamViewerMeetingAddIn.AddIn.DoStartup()

   at TeamViewerMeetingAddIn.AddIn.CheckOnlineTimer(Object sender, EventArgs e)

   at System.Windows.Forms.Timer.OnTick(EventArgs e)

   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)

   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************

mscorlib

    Assembly Version: 4.0.0.0

    Win32 Version: 4.6.1076.0 built by: NETFXREL3STAGE

    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

----------------------------------------

ManagedAggregator

    Assembly Version: 1.0.0.0

    Win32 Version: 1.0.0.0

    CodeBase: file:///C:/Program%20Files%20(x86)/TeamViewer/outlook/ManagedAggregator.DLL

----------------------------------------

TeamViewerMeetingAddIn

    Assembly Version: 10.0.47484.0

    Win32 Version: 10.0.47484.0

    CodeBase: file:///C:/Program%20Files%20(x86)/TeamViewer/outlook/TeamViewerMeetingAddIn.DLL

----------------------------------------

System.Windows.Forms

    Assembly Version: 4.0.0.0

    Win32 Version: 4.6.1055.0 built by: NETFXREL2

    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

----------------------------------------

System

    Assembly Version: 4.0.0.0

    Win32 Version: 4.6.1055.0 built by: NETFXREL2

    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

----------------------------------------

System.Drawing

    Assembly Version: 4.0.0.0

    Win32 Version: 4.6.1068.2 built by: NETFXREL3STAGE

    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

----------------------------------------

Microsoft.Office.Interop.Outlook

    Assembly Version: 14.0.0.0

    Win32 Version: 14.0.4760.1000

    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.Office.Interop.Outlook/14.0.0.0__71e9bce111e9429c/Microsoft.Office.Interop.Outlook.dll

----------------------------------------

office

    Assembly Version: 14.0.0.0

    Win32 Version: 14.0.4760.1000

    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/office/14.0.0.0__71e9bce111e9429c/office.dll

----------------------------------------

System.Core

    Assembly Version: 4.0.0.0

    Win32 Version: 4.6.1055.0 built by: NETFXREL2

    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

----------------------------------------

WindowsBase

    Assembly Version: 4.0.0.0

    Win32 Version: 4.6.1073.0 built by: NETFXREL3STAGE

    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll

----------------------------------------

************** JIT Debugging **************

To enable just-in-time (JIT) debugging, the .config file for this

application or computer (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.

For example:

<configuration>

    <system.windows.forms jitDebugging="true" />

</configuration>

When JIT debugging is enabled, any unhandled exception

will be sent to the JIT debugger registered on the computer

rather than be handled by this dialog box.

how to update the TextBox attributes dynamically in MVC inside .cshtml file?

$
0
0

Hi Techies,

                    I have a control like below 

 @Html.TextBox("CustomerDetails.LastName", Model.LastName, new
        {
            placeholder = "Last Name *",
            @class = "text-field-half",
            data_parsley_required = "true",
            data_parsley_pattern = "^[a-zA-Z0-9 ]+$",
            data_parsley_trigger = "blur",
            maxlength = "100",
            size = "25"
        })

here currently i have added last name field as required. but i need this textbox required based on my other property tells that  as required.   Means i have other property in my model like "IsLastNameRequired".

so i was trying to set the below condition from

data_parsley_required = "true" to data_parsley_required  = Model.IsLastNameRequired? "true" : "false"

is that correct? because it is not updating whenever i am changing the value of "IsLastNameRequired".

what i need to do to update this data_parsley_required attribute of the textbox when i am changing the value of "IsLastNameRequired".

please let me know if there is any questions.

System.Speech.Recognition alternates confidence values issue

$
0
0

Hi

I am using the "System.Speech.Recognition" namespace to perform speech recognition on a wav file. The trouble is that the alternate matches I get from Result.Alternates are neither sorted according to confidence, nor the recognized text matches the alternative with highest score. My code snippet:

Console.WriteLine("Recognized text = {0}, score = {1}", e.Result.Text, e.Result.Confidence);// Display the recognition alternates for the result.foreach(RecognizedPhrase phrase in e.Result.Alternates){Console.WriteLine(" alt({0}) {1}", phrase.Confidence, phrase.Text);}

And output example:

Recognized text =She had said that fit and GracieWachtel are all year, score =0.287724
alt(0.287724)She had said that fit and GracieWachtel are all year
alt(0.287724) she had said that fit and gracie wachtel are all year
alt(0.2955212) she had said that faith and gracie wachtel are all year
alt(0.287133) she had said that fit and gracie Wachtell are all year
alt(0.1644379) she had said that fit and gracie wachtel earlier
alt(0.3254312) jihad said that fit and gracie wachtel are all year
alt(0.2726361) she had said that fit and gracie wachtel are only are
alt(0.2867217) she had said that fail and gracie wachtel are all year
alt(0.2565451) she had said that fit and gracie watchful are all year
alt(0.2854537) she had said that fate and gracie wachtel are all year

Any idea why does it happen?

Can I detect when an assembly has a COM interface?

$
0
0

Is there a simple way to check, from powershell, if an assembly has a COM interface, so we know to call regasm on it?

We are using powershell to run gacutil on each assembly in a directory, but then need to maintain a hard coded list of the ones which require regasm to be called as well.

Or is it ok to just run regasm on all of them, even when some don't have a COM interface?


Build multiple .net projects using ant tool

$
0
0

Hi All

I have multiple projects in different folders.I want to build each projects individually. Since we are using ANT tool to build the java projects,Client wants us to use the ANT tool to build the .Net projects.

Could you please provide the guidance to do this.I have checked online ,but couldn't get much information on this.

There is a NAnt tool for.net projects .But the client wants us to use ANT.

Thanks in Advance

Native C++ class for C#

$
0
0

Hello i'm new in programming and have task to done please help me on this.

I want to use C++ class in C#.

My .h file is like this:

struct XMFloat3
{
public:
float x; float y;float z;
XMFloat3(){}
XMFloat3(float _x, float _y,float _z){x = _x;y = _y;z = _z; }
};

class Car
{
public:
XMFloat3 m_position;
char* m_name;
int m_model;
double m_price;

void setPosition(XMFloat3);
void setName(char* );
void setModel(int);
void setPrice(double);

XMFloat3 getPosition(){return m_position;}
char* getName(){return m_name;}
int getModel(){return m_model;}
double getPrice(){return m_price;}

void SetInformation(XMFloat3 position,char* name,int model,double price);
~Car(void);
static Car* getInstance();
private:
Car(void){}
Car(XMFloat3 position,char* name,int model,double price){}
static Car* instance;
};

-----------------------------------------
I create clr\library project with Wrapper Class definition like:

public ref class WrapperClass
{
public:
WrapperClass();
void setInformation(XMFloat3 position,String^ name,int model,double price);

void setPosition(XMFloat3);
void setPosition(float x,float y,float z);
XMFloat3 getPosition(){return obj->getPosition();}
void setName(String^ name);
String^ getName(){return gcnew String(obj->getName());}

void setModel(int);
int getModel(){ return obj->getModel();}

void setPrice(double);
double getPrice(){return obj->getPrice();}

float getX(){return obj->getX();}
~WrapperClass();
private:
Car *obj;
};

.....................................................................................

But when i use this Wrapper class function getPosition() in C#, in C# getPosition() Declaration is like: 

XMFloat3* getPosition(XMFloat *);

That's not perfect for my use please tell me if i doing any wrong in up there or suggested how to use User Defined Datatype in such scenario.

And 2nd question is How User Defined data types are access or use in C#. e.g if i want to pass XMFloat3 data from C# how is it possible?? (I create XMFloat3 struct in C# .cs file and try to use it but its give type matching errors...)

Thanks

invoking an exe through a webpage (Asp.net) throwing error message "No application is associated with the specified file for this operation"

$
0
0

Hi

We have one webpage (asp.net and c#) we are invoking an exe through this page using below command.

System.Diagnostics.

Process.Start(strRACFexe, ddlIDType.SelectedValue.ToString()+ " "+ ddlEnvironment.SelectedValue.ToString()+ " "+ strRequestNo);

This exe basically sleeps for 5 min and then reset pwd Teradata servers id. Earlier it was working fine but now we have observed that this webpage start throwing error after some time and then keep throwing error until and unless the app_pool of the website is not recycled. We also observed that there is high usage of memory for w3wp processes. AS soon as we recycle app_pool or kill the w3wp processes the web page will start working.

any suggestion and idea will be highly appreciable.

Help please!!! (80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). )

$
0
0

I have just created a simple web site using VB in VS2010 with reference to SourceSafe using Interop.SourceSafeTypeLib.dll, but I'm having lots of trouble on publishing it!!!

In VS everything works fine, but after publishing on the webserver I get the following error:

Retrieving the COM class factory for component with CLSID {783CD4E4-9D54-11CF-B8EE-00608CC9A71F} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). 

HELP PLEASE!!!!

I'm in big trouble if I can't get this done fast....

 

Sorry if my english is not to good!!!


Import of SVsServiceProvider not working in custom editor

$
0
0

Hi all,

Now I want to get TFS object in VS 2015. i tried the SVsServiceProvider to get DTE but not working.

According to a MSDN article (http://msdn.microsoft.com/en-us/library/ee834473(v=vs.110).aspx) I implemented this exactly like this:

 [Import]
 internal SVsServiceProvider ServiceProvider = null;

 DTE dte = (DTE)ServiceProvider.GetService(typeof(DTE)); //error null

 tfsSvrExt = dte.GetObject("Microsoft.VisualStudio.TeamFoundation.TeamFoundationServerExt") as TeamFoundationServerExt;

Anybody found this issue or better idea to get tfs object in vs2015? Thanks.


True mastery of any skill takes a lifetime.

Build error

$
0
0
I have winrar installed not in c:\Program files. But it tries to use this path. The compiling project is created with external template (AutoCad Plug-in).

Looking for Best way to TO bulk insert / update data in database

$
0
0

Hello Mates, 

I have the following requirement: a Data Table loads a view of data from the database using a SQL connection  

Finally after some data modification I want to update back to database.

        I mean that data modification needs to submit back to database.

        I have a special case where data will be modified from the and transforms in different action like merge clone etc         but structure remains same.


Note: May be Datatable done changes or added new rows in memory but I want submit the update once

Actually i am deleting all  rows in Database  before performing  Bulk insert to DB 

Sample flow 

Load Table in DB into Datatable type ( assume 15000 rows )

Datatable Do modification to table / add new rows  // update   // etc.... ( assume 15000 + 500   added rows ) and few rows modified  finally i have  new data table 

Delete existing  data in DB   ------  i know its not correct approach 

Submit Datatable using Bulk insert  

I perform same think by using Sql Statements but i feel slow please guide any approach which is faster and better way 

I am looking for ideas, please give some inputs on this

some sample code or links

Thanks Ranjith


Ranjith@Learner @Microsoft products


COMException Error

$
0
0

Hello,

I am using a software program that has an option to import/export data from/to Excel. I am running into an issue where whenever I try to export to Excel I get a COMException 0x80010001. After doing some research we found that using Excel add-in Crystal Ball is causing some type of conflict with my program. If the add-in is disabled in Excel, I am able to perform import/exports successfully. Crystal Ball has an option that allows the program to be started when Windows starts up which means that the COM function is always running, disabling this option seems to be the workaround for now but my question is if there is some sort of limitation of the number of COM instances that can be running at one time.

Please let me know if you need further details and thank you in advanced for your assistance.

Regards,

Robert D.

Explanation of PrincipalContext.ValidateCredentials behaviour over LDAPS

$
0
0

Hi,

I am using PrincipalContext.ValidateCredentials(string, string) to validate user credentials.  I am encountering behaviour that I am unable to explain and have, so far, been unable to clarify through usual searches and forum visits.  Here is the behaviour, the  credentials can be assumed to be correct on each call. The non-SSL behaviour is what I would expect.  The SSL behaviour is not as expectedin my understanding of the method.

Not using SSL/TLS

  • User is enabled and NOT expired - method returns TRUE
  • User is disabled and NOT expired - method returns FALSE
  • User is enabled and EXPIRED - method returns FALSE
  • User is disabled and EXPIRED - Method returns FALSE

Using SSL/TLS

  • User is enabled and NOT expired - method returns TRUE
  • User is disabled and NOT expired - method returns FALSE
  • User is enabled and EXPIRED - method returns TRUE
  • User is disabled and EXPIRED - Method returns FALSE

To summarise - when both machines in the negotiation (app server and domain controller) have the required certs installed, they will use SSL (port 636).  In these circumstances the method returns TRUE for Expired accounts but when not using SSL (port 389) (for example the app server does not have the cert installed) the method is returning FALSE for Expired accounts.

I would expect the return value to be the same for expired accounts in both scenarios, but it's possible I'm not considering something.

Thanks

Business Rules Engine and Business Rules Framework in Azure ?

$
0
0
Is it possible to use the .NET Business Rules Engine and Business Rules Framework in an Azure application?

Bill Zack

Exporting tlb from Assamblies

$
0
0

I have two assemblies ComVisible, one define the interfaces (e.g. a.i.dll), and one define the classes which implement the interfaces (e.g. a.c.dll)

if I use tlbexp a.i.dll and tlbexp a.c.dll in the second tlb are only the coclasses and have no interface information inside

Haw can I generate from two assemblies only one tlb?

Thanks

Web.config problem

$
0
0

Hi all,

I have one issue in the web.config file.

i need to know how we can add &

MY url contains &, and i need to make that url working

in the below code it gives me an error when i use &Viewmode=List

what i need to replace & with to make it working

<

addkey="ABC"value="http://www.google.com&ViewMode=List"/>

Viewing all 8156 articles
Browse latest View live


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