Uğur UMUTLUOĞLU
Web Technologies, Microsoft and .NET Technologies

Listing Assembly Files in GAC in Normal View

Tuesday, 6 July 2010 17:35 by ugur

We need to back up the files in the production environment especially when we update our projects in this environment. There is not any problem to reach the files under IIS but we don’t have a chance to copy the dll files inside the GAC(Global Assembly Cache) because Windows lists these files in a different view. If you want to reach the dll files inside the GAC(Global Assembly Cache) directly, the command line that will be written on MS-DOS screen will help you. 

regsvr32 –u C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll

By this command, the assembly files inside the GAC are listed in normal view. After you back up the files, if you want to switch to old view you must use the same command without using –u parameter as given below;

regsvr32 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll

PS: Sometimes you can see that the files aren’t listed properly although you execute the second command. In this case, you can try to refresh the page or close and reopen the page.

Tags:   ,
Categories:   .NET Framework
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Showing XPS Documents with DocumentViewer Control in WPF

Saturday, 20 December 2008 02:11 by ugur

XPS is a file format that is started to be commonly used with the release of Windows Vista. Word, Excel, PowerPoint files can be translated into XPS format and can be displayed even in a computer in which Office is not installed via the help of an explorer program such as Internet Explorer 7. In this post, I will try to explain how to display XPS formatted files in WPF (Windows Presentation Foundation) applications with DocumentViewer control. 

We need an XpsDocument object in order to display a XPS file on DocumentView that is a control comes with WPF. Because this class is not included in mscorlib.dll, we must add ReachFramework.dll to our project.

Adding ReachFramework.dll to project's references
Adding ReachFramework.dll to project's references

We can move to our application part after adding related dll file to our project references. In this part the procedure is very simple actually; we add a DocumentViewer control to our application form and we add two code lines that can be seen below to the Loaded event of the application form.

Window1.xaml

<Window x:Class="WpfDocumentViewerXps.Window1"

   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

   Title="DocumentViewer ile XPS Dosyalarının Görüntülemesi" Height="320" Width="600">

    <Grid>

        <DocumentViewer Name="documentViewer1" />

    </Grid>

</Window>


Window1.xaml.cs

...

using System.Windows.Xps.Packaging; //Required namespace

namespace WpfDocumentViewerXps

{

    public partial class Window1 : Window

    {

        public Window1()

        {

            InitializeComponent();

        }

        private void Window_Loaded(object sender, RoutedEventArgs e)

        {

            //With GetFixedDocumentSequence method, XpsDocument can get XPS file content

            XpsDocument xps = new XpsDocument(@"D:\test.xps", System.IO.FileAccess.Read);

            documentViewer1.Document = xps.GetFixedDocumentSequence();

        }

    }

}

 

XPS document can be seen on DocumentViewer control
XPS document can be seen on DocumentViewer control

 

Tags:  
Categories:   .NET Framework
Actions:   E-mail | del.icio.us | Permalink | Comments (8) | Comment RSSRSS comment feed
 
Add to Technorati Favorites