.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Get Assembly info of my current C# Application

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :.NET Framework

Hello, developers...

How can i get the assembly information of my current C# application, for example its GUID?



Amin Mashayekhi

View Complete Post

More Related Resource Links

Registering controls of current assembly object reference NOT set error


Hi There,

I have created a simple ASP.net Web Application (2.0) and have added a web user control.

Now in my page I have added this control but I have registered like this,

<%@ Register Assembly="WebApplication1" Namespace="WebApplication1" TagPrefix="Custom" %>

Which means I want to access all the controls in my current Web Application project

Then I have added my user control like this,

<Custom:MyUserControl ID="MyUserControl1" runat="server" PublicProperty="Hello" />

Every thing is fine but when I execute the project, NO control on my user control gets "instantiated" and thus I receive error "Object Reference Not Set"

Note that My Control has,

1) Public property PublicProperty as String

2) 1 Label control

In Load Event Handler I am setting Text property of Label Control to PublicProperty. Here object reference NOT set error occurs (which means Label control is NOT initialized).

I don't want to register my control using Src, TagPrefix etc. Any ideas?


How to set the default culture Info for all thread of an application independant from the Windows UI


A classic 'european' topic?

I am working with Windows7Pro in German, and VS2010 in English. I whish I had all exception handling in english.
Thus, I set the explicly the current culture to english:
 var culture = new CultureInfo("en-us");
 Application.CurrentCulture = culture;
        Thread.CurrentThread.CurrentUICulture = culture;
        Thread.CurrentThread.CurrentCulture = culture;

But I do still have some exception in German, because 'by design', .NET Framework considers the Windows UI language as default culture when a new thread in created (e.g. by GUI controls), as I read here http://www.dotnetmonster.com/Uwe/Forum.aspx/winform/14177/setting-culture-of-threads

What is the motivation for such a design? It has always been a problem for us in Europe working with multi languages: it is quite difficult to ensure the software is working properly whereever it is rolled out.
Is there a way to define the default culture of all children threads?

Uploading assembly at runtime through Windows Application


I am desigining a windows form wherein I allow the user to upload a particular assembly file. The assembly file can be present at any location on the user's hard drive. I want to now load this assembly and read the classes present in this assembly. I am doing this using Reflection, however I am not unable to unload the assembly which is once loaded  through reflection. I have tried using AppDomains, but I am unable to load the assembly through AppDomain. Whenever I try to load my assembly from the appDomain I get a error message "The specified assembly file or one of its dependencies does not exist". I have set the ApplicationBase path of the AppDomain to the location where the assembly file is being uploaded from. However I am still not able to load the assembly from the AppDomain.

Can anyone please let me know in case I am missing something. Any help on this will be highly appreciated.




Assembly only used in xaml not copied to application folder


Hi, I have used a couple of assemblies (in a control library) where they have stuff (eg properties) only ever referenced in xaml. In these cases, the assemblies, are not being copied to the applications main folder.

As soon as I reference something in them from normal C# code, they get copied!

THis is in dev studio 2010, has anyone else had this, and know how to get around it?

Thanks in advance



How to get current user session in Windows application C#?



I am trying to create a Windows Application similar to facebook friend finder.exe in .NET. The steps I have followed to achieve this is as follows:

1. I have created a webservice containing webmethod SaveContacts(string firstname, string lastname, string number, string photo, string email, string userid).


2. I am consuming the webservice in a Windows Form application and calling the above mentioned function.

Now, I want to get the current logged in user ID which through the windows form application which is something tedious to me.

If anyone have any idea how to achieve this. Please help.






SPContext.Current.Web.CurrentUser null in application page on 2008 r2 server

With my current situation I have:
a wss3 development environment on a 2003 R2 server
then a production 2008 r2 server.

For some reason on the 2008 server the SPContext.Current.Web.CurrentUser object is null for users who are site collection administrators but may not have permission to log into the server itself; however, on the 2003 R2 server the code works fine for those users.
When googling around, I had seen something about nt permissions on the bin folder sometimes being and issue until asp.net cache picks up the dll but this is a page in the _layouts directory and the code is in the .aspx page itself. It works fine for me as a system administrator on either machine.

Any suggestions? Thanks.

Application.Current.MainWindow.InvalidateVisual(); not working


Hello all,


I am now working on the application which needs to get screenshots of WPF applications, the approach I use is injecting into target WPF application code and hooking Direct3D functions to intercept EndScene events and grab backbuffer.


The issue I have is that since the moment I inject into the application code, there is no change in visual representation of its windows then EndScene is not called, but I need to get a first screenshot as soon as possible. For that purpose I would like to force redraw of entire main window of the application. For this pupose in the injected code I call


Dynamically get the current instance of the workflow within a re-hosted WPF application



the scenario is: I create a re-hosted WPF application for the workflow designer, and within this designer I can edit the workflow(sequence, flowchart) with pre-defined and custom activities. The question is, how can I programmatically get an instance of the current workflow. Thereafter I can do some manipulations on this instance.



Form based authentication on current web application SharePoint 2010



I have question about creating form based authentication. I want to have different authentication in the same web application in the same time. For now I have windows authentication and I want to extend it to Form base authentication. I follow procedure on link http://blog.summitcloud.com/2009/11/forms-based-authentication-sharepoint-2010-fb/ step by step but it doesn't work. Also when I try to change authentication in Central administration to Forms it is not possible because that option is disable. Is there any setup for overcome this issue.

Thank in advice.


Update Webpart Assembly info programmatically



We have a requirement where in we need to update all the old custom webpart which are added to the portal with new Assembly information. The way we have planned is to create a console app, iterate through all the Pages Library withing each Site and Sub-site, get the WebPart Collection and once the "SPWebpartCollection" object is created, use System.Reflection.PropertyInfo and get all the property. I am done almost uptill here, but now stuck on how to proceed further. I would like to change the WebPart Assembly and Namespace information. The reason why this is required is, earlier earlier each webparts were having different dll. Now we have clubed all the webpart under one Assembly and the namespace are kept same now. But because the webpart were added to the page manually, they are holding the reference to the old assembly. The other way would be to remove the webpart and re-add the webpart which is not very much accepted when the number of sites and sub-sites involved in more than 1500.

Any solution would be really appreciated. Thanks.

Regards, Paddy

Microsoft's Collaborative Application Markup Language (CAML) Loop

discovered an interesting error recently while working with Microsoft's Collaborative Application Markup Language (CAML) that, surprisingly, had received no ink. Partly what surprises me about this is that the error may require you to rewrite large sections of your code if you haven't previously considered this SharePoint limitation. I'll start with some context, but first of all the error is:

Integrating a Legacy Web Application in SharePoint

This month we will continue with the theme of deploying Microsoft's SharePoint as a company intranet by describing a method for integrating a legacy Web application inside a SharePoint site.

In many companies the intranet site is not just a home page with announcements. It houses Web applications used by many different departments. In last month's article, I built a page to search the employee table in Northwind (the sample database included in Microsoft's SQL Server). This month, I will move the Web pages used to add/remove records from the table into the SharePoint intranet.

MVC architecture in ASP.Net using C# and Microsoft Data Access Application block

The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:

Model. The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).

View. The view manages the display of information.

Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.

High-Performance .NET Application Development & Architecture

It has always been a goal of project architects to plan an effective strategy from the ground up in regards to an new application. All relevant factors are taken into consideration with respect to the application, from its design and layout to a functional website infrastructure. Pre-.NET strategies and design guidelines still effective now were developed with Microsoft's DNA (Distributed interNet Application) platform. This model successfully served the purpose of architecting N(any number of)-Tier (levels) applications. In its basic sense, as in most robust, distributed applications, you'll architect 3 main layers or Tiers: presentation, business rules and data access.

Application architecture in asp .net

Application Architecture is the most important process of developing a good application. Some people tends to jump into coding without any architecture laid. Later we see those people changing the architecture and finally the application had to be developed from the scratch with the correct architecture.

In this article I will describe some details about how you can improve the architecture of you application. This article is targeted to the beginner's audience.

Improving Application Performance in .Net

Application performance has always been a concern for Web Application developers. This article contains guidelines and tips for maximizing application performance in ASP.NET.

Like Celebrities - info about all celebrities

Like Celebrities - info about all celebrities
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend