|
I am invoking VB.NET compiler on the fly to create an assembly in memory and then executing the methods from it. It works fine if I give Full Trust to code execution in .NET security config.
I would appreciate if anyone can point to an info on how to configure .NET and what I should do in my assembly to give Full Trust only to it but not all code on the machine.
In other words - what is the minimum I(developer) and administrator should do to allow my in-memory assembly to run?
I saw a lot of articles on this but they all talk about strond names and importing them from a file (exe or dll) to a new security group etc. I do not have the file and every time my assembly is created fresh in memory.
Thanks in advance
VRubins
|
|
|
|
|
|
hi,
you can try this:
[assembly:ReflectionPermission(SecurityAction.RequestMinimum, ReflectionEmit=true)]
[assembly:SecurityPermission(SecurityAction.RequestMinimum, SerializationFormatter=true)]
Write this before the class declaration. If you need more info on this look into .NET Quickstarts and look for
How Do I...Request the permissions my code needs?
in the "How Do I...?" section.
this might solve your problem.
regards,
Aryadip.
Cheers !! and have a Funky day !!
|
|
|
|
|
1) When we launch .Net exe(Managed code) and un-managed old exe how OS know how to launch .net exe in CLR
2) What is the advantage of APPDOMAIN other than consumption of low memory
|
|
|
|
|
1) The PE headers tell the OS that.
2) AppDomain has security advantages - no managed code will access code in a different appdomain than their own, unless you explicitly enable them to.
There are only 10 kinds of programmers - those who understand binary, and those who don't.
|
|
|
|
|
Please help! I am new to VC++ and have no idea where to start. I have VB.NET DLL that I need to call from an existing VC++.NET App. How can I do this?
|
|
|
|
|
1. Add a reference in your C++.NET project to your VB.NET Project (if in same solution) or the .dll itself if not part of the same solution.
2. Make sure you use the compiler switch /clr when compiling the C++ project.
3. In your code you might want to add a #using statement followed by the namespace of your VB.NET dll.
4. Then to create a new instance of something defined in your VB.NET dll, say you defined a Foo class do this:
__gc Foo myFoo = new Foo();<br />
<br />
myFoo.DoSomething();
There is a little more to it, but msdn.microsoft.com has plenty of info on this. This post is all from memory, but it is the gist of it.
Good luck.
R.Bischoff
.NET, Kommst du mit?
|
|
|
|
|
I am trying to write a simple plugin using C++ but all the examples that i found were written in C#.
Does anyone have a C++ plugin sample that I can use to start with? Thanx a lot
|
|
|
|
|
|
How do i get the subnet mask configured on a m/c using the .NET framework?
Thanks.
Chen Venkataraman
|
|
|
|
|
Ok, I am using Visual Studio .NET & .NET Framework 1.0, and I want to upgrade it to .NET 1.1.
I've already downloaded and installed the .NET Framework 1.1 redistribute package, but VS .NET doesn't seem to recognized the new verison and I am not able to use System.Windows.Forms.FolderBrowserDialog which is only supported in 1.1 version.
Help please!
Thanks!
|
|
|
|
|
VS.NET 2002 can only target the .NET Framework 1.0
to target .NET Framework 1.1 you need to have VS.NET 2003
|
|
|
|
|
After purchasing and installing Win 2000 Professional and VS .NET Studio 2002 Academic some time ago, I was able to create Web projects as long as they were placed in thec:\Inetpub\wwwroot directory (i.e. a mapping existed between that directory and the url http://localhost). I was never able to install the IIS 5 Snap In from Win 2000 Professional so I never was able to configure other virtual directories. Recently, I converted my file system to NTFS as a prelim to upgrading to VS Studio .NET 2003 Professional. After the conversion I cannot run or create Web apps with VS .NET Studio 2002 because the mapping with the "default website" does not exist. Does anyone know a way arround this short of dealing with MS Support?
Gary at home
|
|
|
|
|
You may want to look into the aspnet_regiis.exe app in your <.NETFrameworkInstallDir> (i.e. c:\windows\microsoft.net\framework\v1.1.4322)
This may fix your settings, I know it helped me when my IIS wouldn't work with VS.NET.
R.Bischoff
.NET, Kommst du mit?
Great Freeware -> Abilon - Rss Reader | Zip Genius | SmartFTP
|
|
|
|
|
if you already checked aspnet_regiis.exe and it didn't fix your problem.
than come to
administrativetool >> ISS >> right click default web site.>> go for properties and choose home directory.
then click on configuration button. And manually configure the .aspx extension (using edit tab)and file path.
like : C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\aspnet_isapi.dll
hai, enjoy coding
Sreejith SS Nair
|
|
|
|
|
How do i create a dll [roject in c++.net using the managed classes. I can do this in the standard c++ but I dont know how to do this with the new .NET framework for c++. Any help in how to do this or simply set up the project would be great -- Thanks in advance
|
|
|
|
|
Its simple.. Just select Managed C++ Class library as your choice in new project window. (File-->New-->Project)
|
|
|
|
|
// I'm using Visual Studio C# and the 'EmailMessage' class. Here you see me attempting to retrieve data
// from: newDataSet1 (dataset), Settings (table), SmtpServer (data column) and convert ToString (strSmtpServer)!
// However what I have below retreives the DataColumn name and NOT the actual data (ie... smtp.yahoo.com).
// I feel I'm so close is scarry...
//Create the SMTP object using the constructor to specify the mail server
string strSmtpServer = (newDataSet1.Settings.SmtpServerColumn.ToString());
SMTP smtpObj = new SMTP (strSmtpServer);
//Send the message
smtpObj.Send(msgObj);
// Have mercy on this newbie and help...
|
|
|
|
|
I think your code only retrieving the column name. You need to access the rows instead of columns...
string strSmtpServer = (newDataSet1.Settings.Rows(0)("SmtpServer).ToString());
The above code should work... Tell me it does.
|
|
|
|
|
Hello, i'm developing a .NET application which is linked with a native C++ library.
I'm using MC++ to be able to import DLL easily and to be able to manage the memory by my own.
I need to design several user controls (in an extern Dll then).
I don't know which language is the most suited to build custom controls as they provide the same access to the .NET framework.
I'v started building them in MC++ because i'm familiar with C++, i can import windows API easilly and some controls need loads of API calls.
Maybe designing custom controls should be done in C# because it's the dedicated .NET language.
C# may be more secure because each external API/struct will have to be specifically redeclared but is it worth it?
I'm excluding VB because i personnaly don't like the syntax.
Thank you for your enlightment.
|
|
|
|
|
Either C++ or C# are suitable. VC++ 7.0/7.1 are fullly capable in .NET. You get the best of both worlds using C++ because you have full access to Win32 without resorting to Interop as in C# Use the language you are most comfortable with.
deckards29 wrote:
C# may be more secure because each external API/struct will have to be specifically redeclared but is it worth it?
It won't have to be redeclared. If you don't want something visible, make it internal or private .
If you're allowing COM interop so others can use the custom controls as ActiveX controls, you can also mark them with [ComVisible(false)] or declare them as above.
Ian Mariano - Bliki | Blog
"We are all wave equations in the information matrix of the universe" - me
|
|
|
|
|
Thank you.
The internal modifier looks good to hide the implementation with Win32 imports.
|
|
|
|
|
Hi everyone.
I'm developer on .NET platform, but I never was intrested in Java. Can you tell me any advantages .NET over JAVA? Or some advantage JAVA over .NET?
Thank you in advance!
|
|
|
|
|
Here's how I see it, as somebody who uses Java and .NET every day:
.NET ADVANTAGES
---------------
1) Good to great integration with Windows, Active Directory, and other Microsoft products and services
2) Ease of integration with C++ code (in Java you must use JNI, not much fun)
3) The C# language is a little cleaner than Java and provides better support for OO development, with properties and a richer set of keywords. (A few things can actually subvert good OO design, like method hiding, but you don't have to use those features.) The language is more suitable for lower-level work than Java, while still providing all the features of garbage collection, multiple-platform deployment, etc.
4) The marketing muscle of Microsoft, nothing to sneeze at, means you'll be looking at green pastures for a while. Microsoft is also committed to supporting .NET for the foreseeable future, and has based much of their corporate strategy on it going forward.
5) The .NET runtime is better optimized for some things; object creation is less expensive in general, method-call overhead is a little less, etc.
6) The CodeDom namespace simplifies the task of dynamic code generation, something not supported in the Java core libraries
7) Excellent, excellent free documentation on everything you may want to do in .NET, with further support through the usually-excellent Microsoft Press books as well as authors of third-party publications (our own Nish and Tom Archer being a good case in point)
8) Ease of deployment for Web services is still far better than anything you'll see from a third-party Java tool IMHO, although I haven't seen the latest versions of Websphere Studio and BEA's tools
9) ASP.NET is better suited to RAD for presentation purposes. I'm sorry, JSP fans, but it's true; I know from experience.
10) Microsoft-centric developers are a little less likely to spend four hours a day at the water cooler engaging in object-oriented oneupsmanship.
ABOUT EQUAL
-----------
All in all, it seems to me that they're about equal in terms of what's provided in their base libraries. Their security models are equally powerful and extensible, although with .NET you'll find it easier to work with Active Directory than othwerwise, no surprise there. Runtime speed of code is about the same in my experience, although I'd bet that calling native code on Windows works faster in .NET than in Java. They both have open specifications. They both have support for embedded code and small devices, with .NET support on the latter growing all the time.
JAVA ADVANTAGES
---------------
1) Actual support for "write once, run anywhere". If you need to deploy on Linux or Unix, Java, C/C++, and/or something like Perl is still your best bet. Mono, the leading *nix implementation of the .NET framework, is still not as mature as the Microsoft implementation, and for reasons that'd require lengthy explanation, the two will probably never be fully compatible.
2) Better support for non-Microsoft technology. This is mostly just because of Java's longer history; while there are rabid .NET fans out there at this moment cooking up reams of open-source code to do just about anything imaginable, the jarheads have a head start. For instance, if you need to write an application to use multiple databases, just about every modern database vendor now provides a great type-4 JDBC driver, but support for .NET data providers is still not complete. (You can mitigate the effect of code branching by using a decent Data Access Layer in .NET.) Oracle and DB2 stored procedures can even be written easily in Java; both IBM and Oracle have invested heavily in the future of Java.
3) Lower cost of entry. I might make some people angry here, but you can still download Java for free and install it on your free Linux OS, and even run your applications on a free Java-based application server like JBoss, the same applications you developed on your free IDE. (.NET has free IDEs available also, such as SharpDevelop, which are great for the price but nothing near as good as Visual Studio .NET .) Total cost of ownership of a high-end site is debatable by wiser and more knowledgeable heads than I.
4) Better support for middleware, with the EJB standard. This is something that's currently lacking in .NET, although I'd guess that the plan is to sell extra "Yukon" licenses as middleware servers, since you'll be able to program stored procedures and other server-side objects in .NET-supported languages in that future version of SQL Server. (Of course, Jonathan Schwarz proclaimed the upcoming death of middleware in a recent issue of Java Developers' Journal. Also, Microsoft has chosen to go with a distributed-component model that is more services-oriented than Sun's; one can argue that this makes it less reliant on middleware from the start. Most applications don't need something like an EJB server anyway.)
5) A bigger developer community. This means you can get Java developers on the cheap, even easier than .NET coders. The .NET programming community seems to be more tightly knit, however, and is growing daily.
6) More access to the source and underpinnings of Java. In addition, there are many companies that provide Java Runtime Environment (JRE) implementations, in addition to Sun.
-Jeff
here, bloggy bloggy
|
|
|
|
|
Thank you Jeff!
Your message is very useful. If I can ask, what do you think, JAVA+Linux==.NET+Windows?
Thank you again!
|
|
|
|