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

"FullFrameworkReferenceAssemblyPaths" parameter is not supported by the "GetReferenceAssemblyPaths" task

$
0
0

When i create a .net 4.5 project in visual studio i directly get the following warning:

The "FullFrameworkReferenceAssemblyPaths" parameter is not supported by the "GetReferenceAssemblyPaths" task. Verify the parameter exists on the task, and it is a gettable public instance property.

When i try to compile it i gets flagged as a error.

If i change to .net 4.0 the error goes away, and if i change back to .net 4.5 the error comes back again.

While having this problem all my references are marked with a yellow triangle.

Im using Visual Studio 2012 Update 2 (11.0.60315.01).


i m getting error in visual when i publish my site error is cannot find wrapper assembly for type library "MSComtLib" and i m not able to publish

$
0
0
i m getting error in visual when i publish my site error is cannot find wrapper assembly for type library "MSComtLib" and i m not able to publish

Lock User account in Active Directory Server 2003 through C# (.Net framework 3.5)

$
0
0
Hi,

I need to Lock user account in AD (AD Server 2003) thorugh C#.

I tried examples from google but it does not work. Any help in this regard would be appreciated urgently.

Thanks,
Amol

How to notify when message arrives in system.messaging.messagequeue?

$
0
0

Hi.

I am new to MSMQ and system.messaging and event notification, and trying to port an old application in VB6 to VB.NET, which used MSMQQueue andetc to read a message queue. There are separate applications sending and receiving to the queue. I have managed to get the sending application working using system.messaging, but am having difficulty working out how to get the receiving application working.

I have been trying to read up on system.messaging and MSMQ stuff, and I can find out how to read a queue etc, but can't find how to trigger the receiving application to read the queue. In the VB6 MSMQ way, they used MSMQEvent and MSMQQueue.EnableNotification, but I couldn't find equivalents in the System.Messaging class. How do I create a running application that knows when to check the queue for a new message? How do I get the event triggered when a new message arrives?

Or do I just use sleep and poll the queue in a continuous loop using DoEvents or BackgroundWorker, or something like that? The receiving application will stay running (as open application or service) on a server.

Can someone give me some leads or show me the best way to do it?

Thanks!

Validate loops in XML using XSD

$
0
0

Hi,

In my application i have a parent node which contains many child nodes. I want to validate the number of child nodes using another XML node elements just before the child nodes.

In the example below, i want child nodes of 'CONTENTS' node should not be more than 5.

How i can do this XML validation using XSD validation?

<DATA><COUNTER>5</COUNTER><CONTENTS><CONTENT ID="1" ></CONTENT><CONTENT ID="2" ></CONTENT><CONTENT ID="3" ></CONTENT><CONTENT ID="4" ></CONTENT><CONTENT ID="5" ></CONTENT><CONTENT ID="6" ></CONTENT></CONTENTS></DATA>

Thanks,

IamHuM

FindJar equivalent for .Net?

$
0
0
Does anyone know of an existing .Net equivalent for FindJar?

If not, I will look into developing one. I would love to have this functionality for .Net as well.


how to obtain declared variable value in a sql statement

$
0
0

this code works in mfc

" DECLARE @Err int, @OrderExists int "
                         " EXEC @Err = CheckForGA800Orders "
                         "   @DBNo      = %d, "
                         "   @LocaleNo  = %d  ",
                         dbNo,
                         localeNo);

I want to make it work with ADO.net. I want to get values of @Err and @OrderExists after executing the statement:

can some one help me please. I tried

  cmnd.CommandType = CommandType.StoredProcedure;
                cmnd.CommandText = "CheckForOrders";
                cmnd.Parameters.Add("@DBNo", SqlDbType.Int).Value =  dbNo;
                cmnd.Parameters.Add("@LocaleNo", SqlDbType.Int).Value =  localeNo;
                SqlParameter outputIdParam = new SqlParameter(" @OrderExists", SqlDbType.Int);
              cmnd.Parameters.Add(outputIdParam);

                conn.Open();
            int result= (int)    cmnd.ExecuteScalar ();
           int xst =(int) outputIdParam.Value;

but got error  stored proc .... does not have out put parameter @@OrderExists

run the cmd- SET command in ms.net

$
0
0

Hello community,

i want to read values like the homeloc from the SET command which can be ran in a cmd-prompt.

I looked for a WMI-class which can give me the homeloc and did not find any.

The dirty workaround would be running the command with shell (cmd / k ....)
If i do that i dont have things like i have if i spawn an own process with system.diagnostics.process - things like  process.waitforexit() or if exitcode <> "0"
What really surprises me is: there is no set.exe in the system.

- How can i find out in such cases where and how the command is being executed ?

- is there another way to enum the Homeloc ?


Startinfo-Arugment turns from Slash to Backslash

$
0
0

Hey communinty,

i want to run a vbs-script from vb.net using Cscript.
Thing is that Argument passed to cscript contains the filename and the switch /sethst:KMSsrv

if i do the following my argument slash is turned into a backslash. Then cscript interpretes the argument as a folder and tells me "noo i cant find an extension for that ... "

The code is:

Dim Relic1 As New ProcessStartInfo
                Relic1.FileName = "C:\WINDOWS\system32\cscript.exe"
                Relic1.Arguments = (Chr(34) & ProgX86Path & "\Microsoft Office\Office14\OSPP.VBS " & Chr(47) & " sethst:kmsSrv" & Chr(34))
                MsgBox(Relic1.Arguments.ToString)
                Relic1.UseShellExecute = False
                Relic1.RedirectStandardOutput = True
                Relic1.RedirectStandardError = True

Regular Expression for a Version

$
0
0

Hi

I am looking to construct a regular expression for the .NET Version for a string variable.

The supported values are:

1.2

1.2.3

1.2.3.4

Each part of the version can only take upto 7 digits.

Can any one help on this?

Thanks

Sahasra

Visual Studio 2010 - Setup and Deployment Project not working properly

$
0
0

I am trying to create setup project using VS2010. In my Application Folder, I put some files. In my System Folder, I also put some files. I build the project successfully and I got msi file. I have installed the application using generated files. So far so good.

But when I check the time stamp of files in Application Folder and System Folder, it is changed. It puts the current time. For example, test.txt file was in the source place was 09/19/2009, but after installation it put the today's date 06/11/2010.

When I create the same msi project using VS2008, it works like expected. There is no problem at all with VS2008.

Is this bug in VS2010.

Kind Regards,

Rajan Kumar

 


Rajan

Regex for comma separated strings

$
0
0

Hi all, I am trying to write a regex for a comma delimited strings, It should be accepting any string of format Name,Name and name should bealpha. One more thing is this validation should happen only if one particularlistitem of a radiobuttonlist is selected and should not do validation for other listitems, my concern is i should do itwithout javascript.Help me with this guys.

Thanks in advance.

Host name resolution

$
0
0

Hello there,

We've built Excel add-in on .Net framework 3.5 that utilizes remote API for data processing.

Everything seems works as expected however one of our corporate customers has reported that our add-in doesn't work within their corporate network.

During few rounds of debug we noticed that add-in can't resolve DNS name by calling System.Net.Dns.GetHostAddresses(String hostNameOrAddress) method. And reports following error: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server.

Customer has strict security environment, so they setup NAT server and transfer their internal IP to our remote one where is API located. On client machine they have added new line to the host file to move the users from our host name to their NAT server. Like shown below:

192.87.56.89 api.somenetwork.com 

What is interesting that Internet Explorer is resolving name correctly and can access remote API, however .Net application (Excel add-in) doesn't.

Can someone suggest where to dig in order to solve or at least understand the problem.

--

Thanks in advance,

George


Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.

$
0
0

Hi,

iam getting the below error when i run the installed stand alone .exe file.

i have tried in debugging and run the C# console application.it is working fine. able to execute the application without any issue. But, when i install the setup and execute the .exe it is throwing the below errors.

installed .exe(application file) is throwing error in both my development environment and deployment server.

Development machine : windows 7 (64bit),IIS7

Deployment Server : windows 2008(64bit),IIS7

i tried all the possible approach and Google to find a solution.no luck.

----------
Message:
Exception Log Generated On Friday, June 07, 2013 at 2:15:16 PM
----------------------------------------------------


Exception Information: Exception #1
----------------------------------------------------
Exception Type: System.InvalidOperationException
Message: Attempt to load Oracle client libraries threw BadImageFormatException.  This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.
Data: System.Collections.ListDictionaryInternal
TargetSite: Int32 DetermineClientVersion()
HelpLink: NULL/Undefined
Source: System.Data.OracleClient

Stack Trace Information
----------------------------------------------------
   at System.Data.OracleClient.OCI.DetermineClientVersion()
   at System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName)
   at System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions)
   at System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.OracleClient.OracleConnection.Open()
   at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoLoadDataSet(DbCommand command, DataSet dataSet, String[] tableNames)
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet(DbCommand command, DataSet dataSet, String[] tableNames)
   at Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.LoadDataSet(DbCommand command, DataSet dataSet, String[] tableNames)
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet(DbCommand command, DataSet dataSet, String tableName)
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteDataSet(DbCommand command)
   at Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase.ExecuteDataSet(DbCommand command)
   at ForceOrphanReportsDAL.DAL.GetOrphansReportDetails()
   at ForceOrphanReportsBL.BusinessLogics.GetReportDetailsBL(String orphanFileName, String outOfSyncFileName)
   at OutOfSyncReports.Program.Main(String[] args)

Exception Information: Exception #2
----------------------------------------------------
Exception Type: System.BadImageFormatException
Message: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
FileName: NULL/Undefined
FusionLog: NULL/Undefined
Data: System.Collections.ListDictionaryInternal
TargetSite: Int32 OCILobCopy2(IntPtr, IntPtr, IntPtr, IntPtr, UInt64, UInt64, UInt64)
HelpLink: NULL/Undefined
Source: System.Data.OracleClient

Stack Trace Information
----------------------------------------------------
   at System.Data.Common.UnsafeNativeMethods.OCILobCopy2(IntPtr svchp, IntPtr errhp, IntPtr dst_locp, IntPtr src_locp, UInt64 amount, UInt64 dst_offset, UInt64 src_offset)
   at System.Data.OracleClient.OCI.DetermineClientVersion()
Category: Error

----------

any help is appreciated! since,this is bugging my head for more than 2 weeks.

Thank You in advance,

Raja Duraisamy.

Why is CompositionHost and CompositionInitializer not part of desktop development

$
0
0

Glenn Block had written a CompositionInitializer for the desktop and I was wondering why this was MEF for .NET framework 4.5?  Is there a preferred way to do the following?  BTW, I know I can Import Foo and this will work.  But I was trying to make it work when I instantiate Foo using new.  I am trying to incorporate MEF in an exisiting project in which some objects are created with new operator.  Is there another preferred method to do this?

    class Program
    {
        static void Main(string[] args)
        {
            Test mytest = new Test();
        }
    }

    public class Test
    {
        public Test()
        {
            ComposeMefContainer();

            Foo foo = new Foo();
        }

        private void ComposeMefContainer()
        {
            CompositionContainer _container;
            var catalog = new AggregateCatalog(new DirectoryCatalog("."),
                          new AssemblyCatalog(Assembly.GetExecutingAssembly()));
            _container = new CompositionContainer(catalog);
            _container.ComposeParts(this);

            CompositionHost.Initialize(_container);

        }
    }

    public class Foo
    {
        [Import]
        Bar abar;

        public Foo()
        {
            CompositionInitializer.SatisfyImports(this);
        }
    }

    [Export]
    public class Bar
    {
        public string Name {get; set;}

        public Bar()
        {
            Name = "Tom";
        }
    }



Occasionally Connected App - using SessionSecurityToken

$
0
0

I am building a WinRT app which is meant to function offline.   While the user is online can I store the authenticated token with an extended expiration (24 hours) with its claims and rely on it later when the system is taken offline?

Can the user re-login to Windows 8 while offline (after a sleep) and the token still be valid for the same user?

BackgroundWorker Strangeness

$
0
0

Here is a very simplified example to demonstrate the issue.  This works just perfectly:

Dim MyBW As BackgroundWorker
Dim bwWorkers As New List(Of BackgroundWorker)

Private Sub btnDoSomething_Click(sender As Object, e As System.Windows.RoutedEventArgs) Handles btnDoSomething.Click

    MyBW = New BackgroundWorker
    Try
        With MyBW
            .WorkerReportsProgress = True
            .WorkerSupportsCancellation = True
        End With
        bwWorkers.Add(MyBW)
        MyBW.RunWorkerAsync()
    Catch ex As Exception
    
    End Try

End Sub

Private Sub MyBW_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles MyBW.DoWork

    Stop  'This is just for testing.

End Sub

But, If I have several different BackgroundWorkers, and want to reduce coding, I try this way:

Dim bwThis As BackgroundWorker Dim bwThat As Backgroundworker Dim bwWorkers As New List(Of BackgroundWorker) Private Sub DoThis_Click(sender As Object, e As System.Windows.RoutedEventArgs) Handles DoThis.Click Dim isOK As Boolean = start_background_worker(bwThis) End Sub Private Sub DoThat_Click(sender As Object, e As System.Windows.RoutedEventArgs) Handles DoThat.Click Dim isOK As Boolean = start_background_worker(bwThat) End Sub Private Function start_background_worker(ByRef bw As BackgroundWorker) As Boolean Try bw = New BackgroundWorker With bw .WorkerReportsProgress = True .WorkerSupportsCancellation = True End With bwWorkers.Add(bw) bw.RunWorkerAsync() Return True Catch ex As Exception Return False End Try End Function

Private Sub bwThis_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles bwThis.DoWork
Stop 'This is just for testing.
End Sub

Private Sub bwThat_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles bwThat.DoWork
Stop 'This is just for testing.
End Sub

Now I run into the problem.  When I click one or the other button to start the job, it doesn't start, and therefore doesn't hit the Stop statement in the DoWork method.  If I stop the Background worker, then start it a second time, it then works and hits the Stop statement.

One of the 2 BackgroundWorkers usually starts fine, and the other doesn't, and must be stopped/started again to work.  In another application, even the first and only BackgroundWorker has the issue.

Once it is restarted, everything works fine, and all of the BackgroundWorker events work properly.

Any idea what could be causing this?  Thanks...


Ron Mittelman

send data to the server via network windows 8

$
0
0
i have a windows 8 metro app and i want to pass or send  some data which are taken from the user to anther pc which is connect to same wifi .si i want best way to do that 

Creating Semaphore throwing an "Access to the port is denied."

session auto expire 5 mint and any click logout to session plz help me c#

$
0
0
session auto expire 5 mint  and any click logout to session plz help me  c#
Viewing all 8156 articles
Browse latest View live


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