I've created an assembly that, because of 3rd party controls, requires full
trust to run. This is no problem when running from the local harddrive, but
when the application is run from a network drive, the application crashes and
want's to send information to Microsoft.
To deal with this, I added code to demand PermissionState .Unrestricted
before any other code is executed. I also added a strong name to facilitate
giving full trust to the application when run from the local intranet.
This solution works like a charm on my computer. When run from the network
location, I receive a message informing me I do not have sufficient
permissions. Using the wizard in the Administrative Tools I can easily allow
my application to run from the network drive.
Content with myself I walk to a collegue to demonstrate the polite message.
I double click the app on the network drive and watch in horror how it
crashes and wants to send info to Microsoft. Searching for the configuration
wizard, I find that users without VS2005 don't get that tool.
My questions:
1. Why does my app crash in stead of displaying my messagebox? What have I
missed?
2. Is there a way to obtain the configuration wizard for framework 2.0
without VS2005? I don't want to change security settings myself, since the
app will mainly be run from the local drive. The wizard is a lot easier to
use for my users than caspol.
Used code (taken from the Sudoku sample on MSDN):
[STAThread]
static void Main()
{
if (HasFullTrust)
{
Application.Ena bleVisualStyles ();
Application.Set CompatibleTextR enderingDefault (false);
Application.Run (new Forms...);
}
else
MessageBox.Show ("Error...") ;
}
}
private static bool HasFullTrust
{
get
{
try
{
new PermissionSet(P ermissionState. Unrestricted).D emand();
return true;
}
catch (SecurityExcept ion) {return false;}
}
} 1 1739
Ok, I've found part of the problem.
The crash is caused because, for some reason, the referenced 3rd party
control crashes my app before the first line of code is executed. When I add
a Full trust CAS code group for the strong name of the 3rd party control, the
app functions as expected.
The reason my app returned a polite error message, whereas it just crashes
on my colleague’s machine, is that the 3rd party control is also present in
my CAG. I missed that the first time.
I still hope someone can tell me why the 3rd party control crashes my app
before a single line of code is executed. I prefer to show an error message
over the 'send info to Microsoft' dialog. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: cybertof |
last post by:
Hello,
I have a custom Excel 2003 .dll assembly, and each time i rebuild the
assembly and place it on the client PC, i have to apply again the
security on the new assembly (same location).
Is there a way to deploy an assembly without having to enable again full
permissions on it once it is place back to its destination ?
Regards,
|
by: Boris |
last post by:
I notice the following strange behavior of the applications running under
..NET Framework.
Let say I have application MyApp.exe which reference assembly MyAssembly.dll.
The MyAssembly.dll is strong named assembly, which is installed in the GAC.
I notice that if MyAssembly.dll is not installed in GAC or the different
version
of MyAssembly.dll is installed in GAC then MyApp.exe starts OK. But as soon as
the MyApp.exe app tries to call...
|
by: wsMarkM |
last post by:
I have a web app running on Windows 2000 with the home directory pointed to a
network share on a file server. We have a long running process which copies
jpg images from user's folders on a network share, processes them and copies
them to another location. Depending on the number of images this can take a
long time. If I update the dll (assembly) in the /bin folder the process dies
and the user is given a "Server Application Unavailable"...
|
by: Christian Kaiser |
last post by:
I want to develop code on a network (mapped) drive.
All the time the execution fails with a security exception. OK, I thought I
know the
reason for that, and set the intranet security to full trust.
BUT: this did not help.
Then, I checked the assembly's rights with MSCORCFG's "evaluate assembly"
and see that my intranet is in fact seen as an internet (!) by the .NET. No
|
by: Patrick |
last post by:
Has been trying to get an ASP.NET DLL's modification date/time for the
"release date/time" to be displayed on the page's footer
Using:
System.Reflection.Assembly
asm=System.Reflection.Assembly.GetExecutingAssembly();
appVer = asm.GetName().Version.ToString();
// get the location of our executing assembly
System.IO.FileInfo inf = new System.IO.FileInfo(asm.Location);
| |
by: R Reyes |
last post by:
ISSUE (reposted)
===========================
Can someone please explain to me why I can't get the MS Word Interop assembly
to work in my VS2005 project? For many people, they say they add the
reference and it works, however when I add the reference the application
can't find it. Not sure why it says the system cannot find the file when it
exists in that location? Please help, thanks in advance...
GOAL
===========================
|
by: bilaribilari |
last post by:
Hello,
I have a huge application thats written in C and C++. The application
crashes and I am trying to find a pattern to these crashes. I recently
got my hands on the DrWatson log and the user.dmp file. On running this
dump using Visual studio, I got a lot of Assembly code that I can't
make head or tail of. I was wondering if I can compile the entire
application on my local box and generate the assembly code so that I
can then pinpoint...
|
by: Vandana T |
last post by:
I created a console application to read and manipulate an Excel file. I added reference to the Microsoft Excel 11.0 Object Library. When I place it in Network Drive and try to run the .exe from my system, it gives error 'That assembly does not allow partially trusted callers.' I tried to make the Network Drive where my Console Application is placed a trusted location in the .NET Framework 2.0 Configuration Tool, by adding a Child Code Group to...
|
by: Carl Johansson |
last post by:
I think I'm going nuts! I have a perfectly fine exe assembly built with
Microsoft Visual C# 2008 Express Edition. When executed from my local hard
drive it runs as exactly as expected. However, when trying to launch it from
a network drive it just won't run. One suggestion I saw was to start the
"Microsoft .NET Framework 1.1 Wizards" and run "Trust an Assembly". However,
after having browsed to the assembly the wizard simply reported that...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |