Managing errors while loading App.config
I am using 'Settings' (the auto-generated Properties.Settings) and
ConfigurationSection derived classes in my application.
If my configuration file (app.config) gets corrupted (or the user changes it
incorrectly) then I would like my application to pick up settings defaults
and not to keep trying to load from the config file, and hence create an
exception, each time.
Both the auto-generated Properties.Settings and ConfigurationSection derived
classes have defaults. What I'm currently getting is an exception every time
I reference one of these settings if the config file is corrupted.
If the config file is corrupted I would like to somehow set the
ConfigurationManager to an empty or null app.config file so that all
subsequent configuration settings calls will return defaults and won't keep
generating exceptions each time.
The application runs fine on defaults and is much better to do this than to
just terminate.
Does anyone know if this is possible? Tag: Hook keyboard events Tag: 136672
Wpf window appearing above windows taskbar
I have developed a wpf application in dot 3.5 framework.
the application is similar to a vista slidebar.The background is
transparent if the focus is not on the application.Its placed on the
right hand side of the window.I made the window to appear full screen
also.
My problem is that the window is appearing above the windows taskbar
whenever the focus is made on the application.
How can I make my window to appear under the taskbar?
Kindly help me with some solution....
Regards
thejes Tag: Hook keyboard events Tag: 136670
OLE call STAThreadAttribute exeception on saveFileDialog.ShowDialog(this)
Hi,
although main() has [STAThread] attribute, somehow my C#/VS2005 win
form application changed to MTA mode. Within the application I create
a backgroud process that does the work to be able to update a progress
bar in the main window. After the backgroud process is completed
(backgroundWorker_RunWorkerCompleted was called), I want to write some
info to LOG-files. Upon calling saveFileDialog.ShowDialog(this) to get
a filename, I get the STAThreadAttribute exception. Just before this
call I checked System.Threading.Thread.CurrentThread.ApartmentState
which is then MTA.
So my questions are:
- what makes my application switch to MTA
- what can I do to bring it back to STA
- why this OLE call
Thanks in advance for any hints!
Stefan
P.S.: This is a repost from
microsoft.public.dotnet.framework.windowsforms Tag: Hook keyboard events Tag: 136660
Window Closure
I've been having a problem where open windows when I'm about to do something
just disappear. The screen will almost refresh and the window I was working
in will have closed or disappeared. It's possible it's a virus but I've
scanned my computer with Panda and nothing comes up. Appreciate any help that
can be offered. Tag: Hook keyboard events Tag: 136656
Remoting and DataTypes
I'm dealing with remoting for the first time (.net 2.0). I can succesfully
call methods that return basic data types (string, bool, etc) but I can't
pass more complicated data types (System.DirectoryServices.DirectoryEntry is
specifically what I want to have returned). Am I just out of luck or is
there something I can do to return that data type? Tag: Hook keyboard events Tag: 136655
Hooking IDataObject.GetData in .Net
Sorry for the cross-posting. I am having a hard time trying to classify
exactly what group this question would apply to.
I had posted an earlier message to
microsoft.public.dotnet.framework.windowsforms trying to find a way to
access the lindex member of the FORMATETC structure for a
CFSTR_FILECONTENTS callback request under C#. After some experimenting
I was able to come up with the following code snippet that receives the
callback with a filled in FORMATETC and allows me to save the lindex
value. Unfortunately, I am now stumped at how to forward the callback
to the .Net framework copy of IDataObject.GetData so that the request
can be processed by the framework and ultimately forwarded to my
override of DataObject.GetData. The location that I would want to
forward the request is marked as "TODO:". Can this be done or do have I
have fully implement my own IDataObject.GetData routine?
internal class DataObjectEx : DataObject,
System.Runtime.InteropServices.ComTypes.IDataObject
{
private Int32 m_lindex;
void
System.Runtime.InteropServices.ComTypes.IDataObject.GetData(ref
System.Runtime.InteropServices.ComTypes.FORMATETC formatetc, out
System.Runtime.InteropServices.ComTypes.STGMEDIUM medium)
{
if (formatetc.cfFormat ==
DataFormats.GetFormat(NativeMethods.CFSTR_FILECONTENTS).Id)
m_lindex = formatetc.lindex;
// TODO: Forward request on to .Net framework
IDataObject.GetData
}
public override object GetData(string format, bool autoConvert)
{
// Handle requests for certain formats and then...
return base.GetData(format, autoConvert);
}
} Tag: Hook keyboard events Tag: 136653
How to get Isolated COM Activation (Registration-Free COM using a .manifest file) to work on Windows Server 2003, Enterprise x64 Edition?
How to get Isolated COM Activation (Registration-Free COM using a .manifest
file) to work on Windows Server 2003, Enterprise x64 Edition?
The Isolated COM examples work on my Windows XP Pro but not on Windows
Server 2003, Enterprise x64 Edition.
On Windows Server 2003, Enterprise x64 Edition I get this error from
applications that use a manifest file to access com objects:
Retrieving the COM class factory for component with CLSID{......} failed
due to the following error 800700c1
On my XP Pro machine i have installed:
ms .net frmwrk 1.1
ms .net frmwrk 1.1 hotfix(kb928366)
ms .net frmwrk 2.0 service pack 1
ms .net frmwrk 3.0 service pack 1
ms .net frmwrk 3.5 framework 3.5 (prereleased version)
on my Windows Server 2003, Enterprise x64 Edition i have installed:
ms .net compact frmwrk 1.0 SP3 Developer
ms .net compact frmwrk 2.0
ms .net framework 2.0 (x64)
here example of Registration-Free COM using a .manifest file that I tested
on both machines:
Isolated COM Activation tutorial:
http://msdn.microsoft.com/msdnmag/issues/05/04/RegFreeCOM/
Isolated COM Activation sample project:
http://download.microsoft.com/download/2/e/9/2e9bde04-3af1-4814-9f1e-733f732369a3/RegFreeCOM.exe Tag: Hook keyboard events Tag: 136645
VS Studio 2005 versus 2008 & .NET 2/3
Hi!
We're developing websites with VS 2005 (.NET 2.0) and we want to move on to
.NET 3.X (Not the whole team but the R&D team).
Do we absolutely need to upgrade to Visual Studio 2008 to do that? Is that
the same thing going from 1.X to 2.0?
Will we be able to open .NET 2.0 projects from VS 2008 without conversions
and still be able to open the same projets with VS 2005?
Thank you very much Tag: Hook keyboard events Tag: 136636
Object from Activator raise Invalid Cast.
Hi;
I have a method that receives one of its parameters receives control of a base class that I made and
it´s inherited from UserControl. This parameter named as ctrl.
In the other parameters receives the necessary information in order to instantiating ctrl, This
control that inherits from this base class.
This instance I am doing with Activator.CreateIntance (assemblyName, typeName). This returns a
ObjectHandle.
Then invoke ObjectHandle.UnWrap() to get back the control and save instanced in a variable
System.Object, whenever I ctrl allowance of such an object to doing casting, And raise
"InvalidCastException"
Wath I do?
Tks.
Alvaro. Tag: Hook keyboard events Tag: 136635
Changind array dimension
Hi all,
in C# is it possible to change a dimension of an array?
Thanks a lot.
--
Luigi
http://blogs.dotnethell.it/ciupaz/ Tag: Hook keyboard events Tag: 136619
when i reference a com object by regsvr32 it then find it in the COM tab, it works ok. but when i reference a com object by referencing the .dll file i get this error in my C# application:
when i reference a com object by regsvr32 it then find it in the COM tab,
it works ok. but when i reference a com object by referencing the .dll file
i get this error in my C# application:
Error 1 The "ResolveManifestFiles" task failed unexpectedly.
System.ArgumentException: Illegal characters in path.
at
System.Security.Permissions.FileIOPermission.HasIllegalCharacters(String[]
str)
at
System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess
access, AccessControlActions control, String[] pathListOrig, Boolean
checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at
System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess
access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath)
at System.IO.Path.GetFullPath(String path)
at
Microsoft.Build.Tasks.Deployment.ManifestUtilities.Util.RemoveDuplicateItems(ITaskItem[]
items)
at
Microsoft.Build.Tasks.ResolveManifestFiles.set_NativeAssemblies(ITaskItem[]
value) WindowsApplication12
Error 2 The
"NativeAssemblies=@(NativeReferenceFile);@(_DeploymentNativePrerequisite)"
parameter for the "ResolveManifestFiles" task is invalid.
WindowsApplication12
Error 3 The "ResolveManifestFiles" task could not be initialized with its
input parameters. WindowsApplication12
I need to be able to reference my com dll without making a registry entry.
how to do this? Tag: Hook keyboard events Tag: 136614
System.Net.WebClient and redirection
I'm grabbing web page using WebClient, and I would like to know if that page
has a redirection...
how could I know that?
is there any dinamyc property in WebClient? Tag: Hook keyboard events Tag: 136605
throttling iocp threads in async server
Hello,
I'm designing an async socket server and I've read that the IOCP thread pool
can overwhelm the System.ThreadPool. I'm thinking about throttling the IOCP
threads by only allowing up to MAX connections to be accepted at any given
time where MAX is less than the number of threads in the System.ThreadPool.
So, for example, if the current number of accepted sockets is N (where N <
MAX), accepting a new connection increments N and closing an accepted socket
decrements N. If N == MAX, then no more new connections will be accepted
until N is decremented. While N == MAX, newly established TCP connections
simply queue up in the kernel waiting to be accepted.
Does this sound reasonable?
Thanks for any help,
Marc Tag: Hook keyboard events Tag: 136604
Missing Assembly Microsoft.SqlServer.ConnectionInfo while using ClickOnce deployment
I'm using vs08 / vb2.0 and am trying to use click once deployment. when I
run the click once installation i get the following error msg:
"Unable to install or run the application. The application requires that
assembly Microsoft.SqlServer.ConnectionInfo Version 9.0.242.0 be installed
in the Global Assembly Cache (GAC) first."
I have .net 2.0, 3.0 and 3.5 already installed on the target machine and I
set the publish status to 'Include' for all required files including this
one.
In the application files window, I set the publish status to 'Include' on
all of this type of files, but in the publish package none of them are
included. By the way, under options, I unchecked 'use deploy file
extensions incase that was confusing the target machine. Before when this
option was checked, all of these files
(Microsoft.SqlServer.ConnectionInfo.dll and
Microsoft.SqlServer.ConnectionInfo.dll.deploy, and many more) WERE included.
However, I still got this error msg. It seems I just can't get past this
point. I'm surprised that this is such a big problem and have seen very
little info on it.
I'm surprised something so simple is so difficult.
any advise?
Thanks.
--
moondaddy@newsgroup.nospam Tag: Hook keyboard events Tag: 136601
WebRequestMethods.Http.Post XML file on HTTPS
Hi,
I have a situation where i have to post an XML document to a thirdparty
application. We have used to following code for a couple of months now and
everything worked just fine. The URL I used was just http and no SSL was
used, but the thirdparty application now implemented SSL and now uses HTTPS.
When I change the URL to HTTPS i get the following exception on
request.GetResponse():
The underlying connection was closed: An unexpected error occurred on a send.
The handshake failed due to an unexpected packet format.
The code:
UriBuilder u = new UriBuilder(AUrl);
u.Port = APort;
WebRequest request = WebRequest.Create(u.Uri);
request.Method = WebRequestMethods.Http.Post;
request.ContentType = "text/xml";
Stream requestStream = request.GetRequestStream();
StreamWriter send = new StreamWriter(requestStream,
System.Text.Encoding.UTF8);
try
{
send.Write(ARequest);
}
finally
{
send.Close();
requestStream.Close();
}
response = request.GetResponse();
Stream responseStream = response.GetResponseStream();
reader = new StreamReader(responseStream);
return reader.ReadToEnd();
Can anyone shed some light on this error?
Thank you in advance. Tag: Hook keyboard events Tag: 136599
WCF managed and unmanaged
I need a reliable and effcient way to connect two modules one writen in
native C++ code and the second written in C# as a WCF service.
The connection should be bidirectional connection.
What is the best way ?
1) COM? and how do I create a bidirectional connection between the 2 modules.
2) MSQueue? Is it effcient enough?
Is it possible to host a WCF server under native ATL windows service?
Is it possible to do .net windows hosting to the unmanaged module safly?
Do you recommend to run the 2 modules in 2 different processes? Tag: Hook keyboard events Tag: 136595
Log specific level with log4net
Hello
I am using log4net in an application. I would like to log with some
specific levels, but I am not sure if it is possibel.
For instance I would like to log ERROR, FATAL and INFO, but not WARN.
The reason is that I would like tol log performance with INFO, but I
do not want to log warnings.
Is this possible?
Peter Frederiksen Tag: Hook keyboard events Tag: 136592
Best way to store a connection string machine wide.
I have several applications running on a workstation all pointing to the same
sql server. I would like a way to save the connectionstring once on the
machine and have all my applications be able to read it. In the event of a
problem where we have to change servers, I would like to be able to update
the connection string in this one place and proceed.
I have examined shared assemblies, and I have thought of storing the
connection string in machine.config. I have been to successful with either
of these methods.
In VB6, is used a dll and it worked fine.
What is the preferred way of doing this.
--
Thanks
Arnie Tag: Hook keyboard events Tag: 136573
Napster installer issue
I have Windows XP and I am trying to download the napster installer.
Everything works up until configuring the napster burn engine. I get a
registry error box there was a problem running the napster installer.
Download and try again. I get this over and over. Napster support after many
trys says something wrong with my computer. Any suggestions? Should I delete
everything to do with Napster in the registry and try again?
Thanks. Tag: Hook keyboard events Tag: 136572
Invalid value for key AttachDBFileName - related to 16-bit calling code ?
This thing is complicated so bare with me.
We have a pure .NET application using an SQL express database which we
deploy via ClickOnce. When we launch the application via the normal
shorcuts (internet or program files) it *always* works.
Now the beauty is that this application has to be launched from a ***16 bit
Delphi 1 application*** (nobody chooses this, neither did we - the 16bit app
will live for at least 2 years - and this application is still used by tens
of thousands of customers). This delphi application has a plugin mechanisms
which enabled us to load 16-bit "add-ins". The short shory is the 16 bit
application uses WinExec (exePath,SW_NORMAL) to launch our app. (we have
control over the parameters but not over the WinExec part - the first
parameter should be an EXE as well)
Since the 16-bit app can't call an appref-ms (we launch the appref-ms file
in program files\ourCompany\ourproduct as created by ClickOnce and
documented in http://safari.oreilly.com/0321197690 ) file directly and since
the clickonce application doesn't take program parameters, we have created
a man in the middle .NET application (MyBoot.EXE) to do the work for us. It
takes the commandline parameters from the delphi app and puts them in a
local file for the .NET ClickOnce app.
Now listen :
- on windows vista it always works
- on windows XP it sometimes works (but most of the time it does not)
- if I manually launch myBoot.EXE with the commandline parameters then it
always works.
The question :
- is there something different with Windows on Windows for 16 bit
applications between XP and Vista or is my Vista machine just faster than
all of the XP machines (3) on which I tested this ?
- how can I overcome this problem ?
(already tried increasing the timeout for the connection string but it
doesn't have anything to do with that - is it the switch between 16bit code
and 32 bit code? - I've also tried launching the .application file but that
doesn't help me either - I've also made the man in the middle a windows
application with an application.Doevents to take care of the warnings for
WinExec)
Thanks for any help,
Van den Driessche Willy.
(sorry for the cross-posts) Tag: Hook keyboard events Tag: 136571
HTTPMODULES are not executed after loading SP1 for .NET Framework
Hi,
I have working product in ASP.NET 2.0 using .NET framework 2.0 where the
HTTPModules is used and the code inside the module is executed fine.
I installed SP1 and now the HTTPMOdule code is not executed. I am using
Server.Transfer as part of my login page which is supposed to execute the
HTTPMOdules code. But it is not exceuting the code. I changed the code to
Response.redirect and the code is executed.
<httpModules>
<add name="Module1" type="HandlerCode.Module1, Module1"/>
</httpModules>
Is this a good solution or Microsoft has identified this as an issue and a
patch is available?
Please let me know.
Thanks,
Rekha Tag: Hook keyboard events Tag: 136569
To ngen or not to ngen?
Hello,
we have a small application on one server that does every 10 minutes
(cronjob) some filetasks and very basic SQL queries against an
installed SQL Server Express instance there.
Does it make sense to ngen that application? Tag: Hook keyboard events Tag: 136566
About .NET Security Error
Hi,
When i call a .net application via UNC Path, it shows a error message.
After debug, i found a error [System.Security.SecurityException] from
Windows generated code [InitializeComponent();].
Anyone knows how to fix? Tag: Hook keyboard events Tag: 136552
fastest searchable datastructure?
Hi,
I need some type of array/list/... In which I can store objects together
with a unique key. The most important thing is performance: I will need to
do the whole time searches in the list of given keys. Which datastructure
will be best suited for this? A Hashtable? The list may contain upto 10^12
items, bit more proably most of the time +- 10^9 of even 10^6...
Thanks a lot in advance,
Pieter Tag: Hook keyboard events Tag: 136549
DataAdapter SelectCommand is NULL!!
this piece of code generate run time error "object reference not set to an
instance" :
SqlAdapter sqla = new SqlAdapter;
sqla.SelectCommand.CommandTimeout = 60;
SelectCommand is null, but when i check the dataset in the designer it has a
select command (actually adapter and table are created by by dragging the
table from server explorer to the dataset). Tag: Hook keyboard events Tag: 136547
.net application using ThinInstall problem...
I all, this is my first time that im using google groups so i dont
know how it work.. but i'm going to try anyway :P
I have build a application on Vb.net 2005 Framework 2.0.
That application is for installing a setup of my company on many
Notebook of our client's.
So like many of you may know Applications .net 2005 need Framework 2.0
to run, and if you are using a .net application on Network ( that is
my case ) you need to give all the time permisions on Microsoft .NET
Framework 2.0 Configuration for that applicaiton to start on
Network ...
But i was looking on google to make a stand alone .exe that dont need
Framework or the permisions to start on Network .. the name is "
ThinInstall" good application ...
Anyway i have used ThinInstall , it as "re-compiled my application"
and sucess, with works on laptop's without Framework and i dont need
to give permisions.. BUT!! , when i try to use my application to Run
the setup that my company sell's , the setup open and stay like
"block" telling " Teams32 Installing " and stays like that for hours
and maybe days... But if i dont use the application ThinInstall to "re-
compile" my applicaton the setup works fine.. so i'm guessing that the
problem is that the Installer think that i have a Framework installed
and then he dont start ?
I hope this question is for this topic.
Thanks in Advance. Tag: Hook keyboard events Tag: 136546
workaround for FileStream bug?
Hi,
I've run across what I beleive to be a bug in the framework or the
underlying Win32 subsystem. I've included the code that triggers the problem
as well as its diagnostic output.
Note that changing 'con.txt' to 'coon.txt' or something else rectifies the
problem so its something about that particular three letter combination.
Any ideas,
Dave
CODE:
-------
try
{
using (FileStream stream = new FileStream("C:\\con.txt", FileMode.Create))
{
// do work
}
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine(e.Message);
System.Diagnostics.Debug.WriteLine(e.StackTrace);
}
OUTPUT:
----------
FileStream will not open Win32 devices such as disk partitions and tape
drives. Avoid use of "\\.\" in the path.
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize,
FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean
bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode) Tag: Hook keyboard events Tag: 136539
About Component integration
I am still new to this component concept, and have read Juval Lowy
book about Component programming in dot net.
At this stage, I have a question about the concept and the
implementation of the component. From his book, it was stated that
components can be bought and used by clients applications. The clients
application will run the component by calling 'interfaces' (method
calls) from components. The book explains about the components
interconnections.
My question is if the component X and Y were bought from the
suppliers (source code might not be included), how could we connect X
to Y? I mean I could use or connect my client application to X, and
also to Y, but how could we connect X and Y in dot net?
Thanks in advance.
Han Liong Tag: Hook keyboard events Tag: 136538
How to debug:looks like infinite loop somewhere in the guts of .Ne
I have a .Net app running on one of my servers. Last night it went in a state
where it was no longer doing anything useful. Some debugging indicated that
one of the threads is spinning somewhere in the .Net framework code. I do not
have private symbols for the framework so I can't tell what it is doing
excactly. But I can see that it is not blocked or waiting for anything. And
!runaway shows that this thread has eaten 12hours of CPU time in last 13
hours of wall time.
Here is a top porition of my App's stack but I do not think it is relevant
to the problem.
0497f318 7936edbc
System.Collections.ArrayList+ArrayListEnumeratorSimple.MoveNext()
0497f324 7a5b0a99
System.Net.ConnectionGroup.FindConnection(System.Net.HttpWebRequest,
System.String)
0497f368 7a58b191
System.Net.ServicePoint.SubmitRequest(System.Net.HttpWebRequest,
System.String)
0497f3a0 7a57ef21
System.Net.HttpWebRequest.SubmitRequest(System.Net.ServicePoint)
0497f3d0 7a57c539
System.Net.HttpWebRequest.BeginGetResponse(System.AsyncCallback,
System.Object)
If I dump native call stack of the thread all I get is System_ni+huge offset.
Does anybody have any idea how to debug this issue any further? Or perhaps
somebody have encountered similar situation. In this case do you recall what
the culprit was?
Thanks
-Alex Tag: Hook keyboard events Tag: 136534
Binary formatting - does it reduce the size ?
Hi
In a nutshell: how can we produce compact persistant versions of .NET objects?
When we first started .NET development five years ago, we opted for TCP/IP
binary formatting for performance and network bandwidth reasons.
We were revisting some of this work and we noticed that our objects, when
saved using a binary formatter aren't shrinking as much as we thought.
Has something changed in .NET? For example, we expected the code below to
generate quite compact binary file, but it doesn't. And it gets worse for our
business objects (they a DataSet as their data carrier) - the binary file
contains loads of (verbose) XML!!!
using System;
using System.Runtime;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
namespace BinaryFormatting_NET1
{
[Serializable]
public class Foo : ISerializable
{
string _s;
int[] _i;
public Foo(string s)
{
_s = s;
_i = new int[1000000];
for (int c = 0; c < 1000000; c++)
_i[c] = c;
}
public void GetObjectData(SerializationInfo si, StreamingContext sc)
{
si.AddValue("_s", _s);
si.AddValue("_i", _i);
}
}
class Class1
{
[STAThread]
static void Main(string[] args)
{
Foo foo = new Foo("hello");
string path =
@"W:\_Common\MiddleTierFramework\MiddleTierFrameWork.Net2.0\Tools\WinSIPPXmlCleanerTests\BinaryFormatting_NET1\foo.bin";
BinaryFormatter bf = new BinaryFormatter();
FileStream fs = new FileStream(path, FileMode.Create);
bf.Serialize(fs, foo);
fs.Close();
}
}
} Tag: Hook keyboard events Tag: 136532
Dimiensioned Measurement
There is now a robust java library solution I've been reading about called
jscience
(http://jscience.org). Is anyone aware of a similar effort in the .net
community? The library supports consistent handling of measurement and
conversion between quantities of the same dimension in just about every
international standard (SI) and non-SI unit of measurement in such a way
that the compiler facilitates design time checking.
I'm in need of a few quantity types to deal with some common dimensions of
measurement in business, with Money being at the top of the list, and
Duration & Length following. Barring an effort along the lines of jscience,
any links
to code samples that do this would be much appreciated.
TIA
Eric Tag: Hook keyboard events Tag: 136528
Architecture and Design Question for C# webapp
I am designing a system which will have a C# backend and an ASP.NET frontend.
My question is about how I would best design the application. The first way
that I am considering doing it is writing a data access layer as part of the
App_Code directory inside the webapp which would just compile and run with
the app. The second option would be to create a server process that
interfaces with the database and then have the web frontend communicate with
the server process by an IPC method (most likely WCF).
It is likely that this application will have to support a large number of
concurrent users if that has an effect on the method selected. Any input
would be appreciated, a pros/cons list would be great if somebody has that
much time. Thanks in advance! Tag: Hook keyboard events Tag: 136524
VS2005 Strange: The breakpoint will not currently be hit. No symbols loaded for this document.
I can't debug a Web Application with VS2005.
I can insert a brakpoint on any class, but I can't debug any page.
An breakpoint on a page code results in the error:
The breakpoint will not currently be hit. No symbols loaded for this
document.
I have searched on internet for more than 2 hours, but nothing solve my
problem.
I ran aspnet_regiis -u then aspnet_regiis -i
I recreate the application on IIS mmc
I deleted any file on
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
I don't know if is a problem of the configuration of the project or a
configuration of the machine.
Please, help me, because I don't know what I have to do anymore.
Thanks a lot.
Roberto Tag: Hook keyboard events Tag: 136522
Domain Policy for CAS?
All,
I have a user control that requires FullTrust to run. I have embedded
it in a web page. If the Machine CAS properties are set to FullTrust
for the given server, everything works fine.
I can set FullTrust for this server because I am the Administrator of
my machine. But what if I were not? How would I be able to run my
user control in IE?
It would be nice if my domain administrator could set a policy stating
that "Server XYZ may have full trust" for all of the systems on the
Domain. Is this possible?
I tried playing with the Enterprise settings in the CAS tool, but this
does not seem to work for me. I need to set it at the Machine level
for it to work! I understand that this is because the CAS system
takes the strictest settings of all three zones (Enterprise, Machine
and User) and the Machine level contains an IntranetZone which does
not have FullTrust.
Further, I tried playing with the User settings, which the individual
users have access to modify, but it STILL doesn't work... probably for
the same reason.
Am I missing something? Can a Domain Administrator give machines on
the network access to my Intranet app?
Thanks,
Brian Tag: Hook keyboard events Tag: 136514
SuspendLayout is not working?
Hi,
During run-time I change the layout of my wondows forms.
The problem is you can see the changing when it happens.
I change some grids in a groupbox (grbRates).
So I do the SuspendLayout() and ResumeLayout when it is done.
That is not working, I read the MSDN and it says this should work.
What am I doing wrong? I use VS 2005, C# 2.0
tia.
Code snippet in an SelectedIndexChange event:
grbRates.SuspendLayout();
if (grbInquiry.Visible)
{
//Set screen.
dgvRatesSelling.Dock = DockStyle.None;
dgvRatesSelling.Width = dgvRatesBuying.Width;
dgvRatesSelling.Anchor = dgvRatesBuying.Anchor;
dgvRatesBuying.Visible = true;
}
else
{
//Default screen.
dgvRatesSelling.Dock = DockStyle.Fill;
dgvRatesBuying.Visible = false;
}
grbRates.ResumeLayout(); Tag: Hook keyboard events Tag: 136510
ASP.NET AppDomain - User code at Initialization
Hi All,
I want to run some user when an Application is started, or when a
worker process is started. Application_Start, Init methods of
HttpApplication in Global.asax.cs are of not use, as they are called
only on the first call to an aspx page in the application. They are
not called during the initialization of the worker process (or)
Application Domain.
Is this possible at all? I came accross a delegate
"AppDomainInitializer", is this of any use? Can it be configured in
IIS to invoke user code?
Any inputs/pointers will be very helpful.
Thanks,
Ashton Tag: Hook keyboard events Tag: 136508
Adding a control from a different AppDomain... how?
Hi,
I currently have an application that must load plugins. It's impossible to
unload an assembly inside a single AppDomain, so I must create a different
AppDomain for each plugin I load so I can uload it when I don't need it
anymore. In the design document I received, I have to create the following :
"Load the assembly, get the configuration user control, display the user
control... When the user control is not needed anymore, unload the
assembly."... I can load the assembly (in a different appdomain), I can get
the user control, I can unload the assembly (by unloading the appdomain),
but I can't display the user control because I receive an exception (which I
don't really understand) : "Remoting cannot find field 'parent' on type
'System.Windows.Forms.Control'."... How can it not find the field 'parent'?
Is there a way to make it work? I can't believe MS didn't think about this
possibility which is used in about all "plugin based" application, so there
must be something I'm missing.
Thanks
ThunderMusic Tag: Hook keyboard events Tag: 136494
Appdomain cannot load assembly... why?
Hi, (My code is at the end of this post)
I have an AppDomain that must load a simple assembly that has only one class
with one method and it does not work... I receive this exception : "Could
not load file or assembly 'ModuleLoader.dll' or one of its dependencies. The
system cannot find the file specified."
Does anyone have an idea of something I'm missing?
Thanks
ThunderMusic
[Code]
*** Main App (calling method) ***
AppDomainSetup ads = new AppDomainSetup();
ads.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;
ads.PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory;
ads.DisallowBindingRedirects = false;
ads.DisallowCodeDownload = true;
m_CurrentMonitorAppDomain = AppDomain.CreateDomain("MonitorLoader", null,
ads);
// The following call fails
MonitoringModuleLoader mml =
(MonitoringModuleLoader)m_CurrentMonitorAppDomain.CreateInstanceAndUnwrap("ModuleLoader.dll",
"ModuleLoader.MonitoringModuleLoader");
*** The "ModuleLoader" library ***
namespace ModuleLoader
{
public class MonitoringModuleLoader : MarshalByRefObject
{
public MonitoringModuleLoader()
{
}
public MonitorBase Load(byte[] LibBytes, string ModuleName)
{
return null;
}
}
}
[/Code] Tag: Hook keyboard events Tag: 136490
Linq to Sql Updates
In all the samples that I have seen to update a table using Linq to
Sql, this is the type of code given:
public static void UpdateProduct()
{
NorthwindDataContext db = new NorthwindDataContext();
var product = db.Products.Single(p => p.ProductID == 1);
product.#PropertyName# = #NewValue#
db.SubmitChanges();
}
In the "real world", a Product would be retrieved and sent to the
client (say using WCF), the client would make a change to one or more
properties, and would then pass back the Product to the server. So, my
question is what code is required to save the Product back to the
database?
I can see that the following would work but there must be a better
way...
public static void UpdateProduct(Product updatedProduct)
{
NorthwindDataContext db = new NorthwindDataContext();
var product = db.Products.Single(p => p.ProductID == 1);
product.#Property1# = updatedProduct.#Property1#
product.#Property2# = updatedProduct.#Property2#
product.#Property3# = updatedProduct.#Property3#
product.#Property4# = updatedProduct.#Property4#
product.#Property5# = updatedProduct.#Property5#
product.#Property6# = updatedProduct.#Property6#
db.SubmitChanges();
}
Is there a way to link the passsd in Product with the DataContext and
therefore just call SubmitChanges without having to re-query the
database first?
Thanks in advance Tag: Hook keyboard events Tag: 136483
Styling of sub ellements in WPF
I have my own WPF class
like this:
<UserControl x:Class="OpticGraph.WellSP"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="300" Width="300" AllowDrop="True" Name="wellSP">
<Grid>
<Ellipse Name="ellipse" Margin="0,0,0,0" Stroke="Black" />
<TextBlock Text="ID" Name="textBlockID"
HorizontalAlignment="Center" VerticalAlignment="Center" />
<Canvas Name="grid">
</Canvas>
</Grid>
</UserControl>
I want to style inner ellement with name ellipse
to make it's Fill (color) Blue.
And i don't understand how it can be done.
I tried this code, but it is not working
<Style TargetType="{x:Type my:WellSP}">
<Setter Property="ellipse.Fill">
<Setter.Value>
<SolidColorBrush Color="Blue" />
</Setter.Value>
</Setter>
</Style>
How can i make it?
___________
best regards
Poly Tag: Hook keyboard events Tag: 136476
Versions of .NET framework
I have noticed that my Windows XP laptop has both version 1.1 and 2.0 of the
.NET framework installed (as well as hotfix KB928366 for version 1.1)
compared with another similar computer that only has version 2.0.
Is having both versions likely to cause me problems?
Can I uninstall version 1.1 safely? I started to uninstall the hotfix but
it gave me a warning that version 2.0 might not work so I stopped.
I'm trying to tidy up my Windows installation because I am having trouble
getting the Adobe website (www.adobe.com) to work properly (e.g. whenever I
try to go to the Flash version test page it times out and getting to other
pages only works sometimes!). The laptop with just version 2.0 of the
framework is able to get to all the adobe web site pages every time. I am
therefore trying to eliminate all differences between the two computers. Tag: Hook keyboard events Tag: 136470
How to stop a paint event handler function by another event
Hi there,
I'm working on a stress test tool for drawing. After start button
clicked, it fires Form_Paint(xxx) event handler to continuous drawing
shapes on screen. Problem is once there is a while loop in the event
handler, so once entering the loop, no other event can capture from
application.
I tried to use a thread but it causes another problem that e.Graphics
will be out of scope, and raise an exception.
Below is my brief of my code. Could any one tell me how to make solve
this problem? Thanks.
private bool bTesting;
private void drawPage(Graphics g)
{
// do something draw...
}
private void Form_Paint(Object sender, PaintEventArgs e)
{
// skip
while(this.bTesting)
{
drawPage(e.Graphics);
}
} Tag: Hook keyboard events Tag: 136465
a simple crawler
Hi, I am trying to write a simple crawler. I have no previous
experience in bots so beware of stupid questions
The url i want to connect to is "http://someSiteName/landing.aspx?
prg=ABC&prg=DEF&prg=GHI"
When i type this in a browser, the server redirects to some other page
(http://someSiteName/otherPage.aspx) and the page gets opened but when
i try to connect by the WebRequest class, i am able to get the
response but it contains some custom error message of that site.
So my question is that what is it that the browser can handle but the
WebRequest class cant? Tag: Hook keyboard events Tag: 136458
rsearch suggestions
I would like to have suggestions on how I could setup the following
applications:
Questions about creating an .net â??executableâ?? 2005 that will not remained
installed once a user enters some data into the application. I also want this
applcation to not require any previous software installed on a users
workstation.
I basically want to setup an application for new users when they are
applying for insurance. This application would preferably be a run as a
windows desktop application versus on the internet. Once the user enters the
save or submit button, I want the application to send the data back to be
processed on a Sql server 2000 or sql server 2005 database.
I have Visual Studio.net 2005 currently and would like suggestions on how
to do steup this type of an application using Visual Basic.net 2005.
Thanks! Tag: Hook keyboard events Tag: 136455
How to listen to keyboard events and not allow them further?
http://www.alvas.net - Audio tools for C# and VB.Net developers
On Jan 21, 11:53=A0pm, "Alexander Vasilevsky" <m...@alvas.net> wrote:
> How to listen to keyboard events and not allow them further?
>
> http://www.alvas.net- Audio tools for C# and VB.Net developers
Hai,
I think, in key boad events one method is there. e.handle=3Dtrue |
false.