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

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

Assembly only used in xaml not copied to application folder

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :WPF

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



View Complete Post

More Related Resource Links

using application configuration file in AppData special folder

Hi! So I understand it is a best practice to save the application configuration files under the AppData folder, rather than in Program Files, since UAC will restrict write acces to the Program Files folder, which is fine. Now, saving the configuration file to another location is no problem, using the SaveAs method. However, when I load the application, I expect some settings to be read. From what I know, this is done either using direct calls to the ConfigurationManager class, either initializing a Configuration object. For the first case, a example is this: if (ConfigurationManager.AppSettings["Title"] != null) { this.Title = ConfigurationManager.AppSettings["Title"]; titleTextBox.Text = ConfigurationManager.AppSettings["Title"]; } For the second case, I would use it like this: Configuration config = ConfigurationManager.OpenExeConfiguration( ConfigurationUserLevel.None); string setting = config.AppSettings.Settings["Title"].Value.ToString(); So, if the application runs in the Program Files folder, an exception is thrown when I save the file. However, if I save the file using SaveAs and save it to AppData folder, obviously, when loading, the settings are not loaded from the AppData folder, but from the configuration file existing in the Program Files folder. One way to solve

Can I add an entire folder to my Web Application Project?

Hi gang, I have been developing my first ASP.Net 2.0 website using the Web Application Project model. I ran into a funny problem and I wanted to bounce it off you guys. I started working with a component called FCKeditor that is an HTML javascript editor. In addition to a .DLL file, you have to add an entire folder of stuff including javascript, CSS, and images. I tried copying the folder as a subfolder under the project root and then tried Add / Existing Item to add the folder to my project, but you can't add folders, only individual files. Am I missing something? Is there a way to add an entire folder of content to my Web Application Project? Thanks,Kevin

Bug With Namespace in xaml that points to assembly with Workflows/Activities?

Hey All, Kind of an oddly worded question, but I'll try my best.   I have a xaml file with a namespace using at the top like this: xmlns:vm="clr-namespace:My.Namespace" This namespace is within an assembly that contains some Windows Workflow 4 designers and activities. [Designer(typeof(DeploymentDelegateDesigner))] public class ExecutionDelegate : NativeActivity { [DefaultValue(typeof(BuildDeployment))] public Activity Body { get; set; } /// <summary> /// /// </summary> /// <param name="context"></param> protected override void Execute(NativeActivityContext context) { context.ScheduleActivity(Body); } } In the above snippet, BuildDeployment is an activity.   If I build this project, an error occurs on the property attribute (DefaultValueAttribute) which states: "Error 43 The type or namespace name 'BuildDeployment' could not be found (are you missing a using directive or an assembly reference?) C:\dev\PathToProject\Activities\ExecutionDelegate.cs 13 30 My.Namespace" I've masked the error to hide some proprietary information.   This ONLY occurs when I have a custom namespace at the top of one of my xaml files. I've tried cleaning/rebuilding the solution, and restarting Visual Studio 2010. I'm at a loss on this one and it is a show stopper. &nbs

Load Silverlight XAML file into WPF application



I want to load the XAML file of a Silverlight application to set data bindings into WPF window. I am able to load when x:name=classname is removed. But I want to load when it is present. Please help me if there way to achieve this.


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.




ASP.NET Application Folder


First of all I would like to thanks Sean Ewington for his article Beginner's Walk for Web Development , which gives me a great opportunity to write some article for Beginner's on ASP.Net Web Development at CodeProject . After writing articles on caching and View State for beginners , I have decided to write a article on Asp.Net Application folder for Beginner's. But I will be back on rest of State management part . Like my others articles I believe this will also give you very good idea on Application Folder . Please give your valuable suggestion and improvement area that I can incorporate with this article and also on my next articles.

Overview ASP.NET Application Folder
ASP.Net 2.0 uses file-based approach. It's means all class files, resource files, Data , Folder are maintain in a hierarchical way. If we are working with ASP.Net 2.0 , we can add files and folder from "Add Items" Options. If we look at a sample application hierarchy , It will looks following figure.

VS2008 WPF Xaml: Is there a path length limit when loading an assembly?



It seems that there is a path lenght limit for VS2008 when loading XAML assemblies.

Using the Microsoft sample Southridge, if the project is stored on "C:\Projects\C# samples\Southridge_Labs\1.Southridge_Fundamentals\Start" the designer does not load the assemblies.

But if I copy my files the project to the root (C:\Southridge_Labs\1.Southridge_Fundamentals\Start) then it works fine.

Basically I have solved my problem, but I want to know if there is an EXPLICIT limit and I cannot find any information related.

Thanks for your help.

Get Assembly info of my current C# Application


Hello, developers...

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



Amin Mashayekhi

XAML WPF assembly not loading into designer


Win 7, VS 2008 SP1, .NET 3.5 Sp1

I have an error on my machine only, but has no complaints on other similar machines. I have a separate xaml file in my local assembly, so I make the declaration in my main XAML file :

A local type xaml is used (in a grid) and is in the body of the main xaml file :
<local:PLTButtonPanel x:Name="BtnPanel" HorizontalAlignment="Left" VerticalAlignment="Top" .....MORE STUFF..../>

This error is displayed when trying to load the designer :
Error 1 Assembly 'MyAppName' was not found. Verify that you are not missing an assembly reference. Also, verify that your project and all referenced assemblies have been built. H:\usr\src\CS\MyAppName\MyAppName\MainFrameWindow.xaml 6
Error 2 The type 'local:PLTButtonPanel' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. H:\usr\src\CS\MyAppName\MyAppName\MainFrameWindow.xaml 220

When I compile, the erros go away, the app runs fine, BUT the Designer never loads the UI into view. It has no problem on ther identically configured machines.

Any ideas what is not set properly ?

Putting dlls on web-site's assembly folder.



How can I put my own dlls on the web-site in the hosting assembly folder,

if I hire an hosting space on some computers  on the internet.


i.e : Using Plex, for Windows 7, Framework 3.5, ASP.NET.


Thanks :)

.Net Framework 4 on Windows Server 2003/IIS6: where is the assembly folder ??

I installed and configured Framework4 on a Windows Server 2003 Standard SP2
following this guide:


Trying to access the website, I received this error:


Server Error in '/' Application.

Access to the path 'C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework\' is denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the path
'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\' is

ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request identity.
ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or
Network Service on IIS 6 and IIS 7, and the configured application pool
identity on IIS 7.5) that is used if the application is not impersonating.
If the appli

Hosting Google Maps in a Microsoft WPF application using XAML

With the Google Maps API for Flash, it is now very easy to add Google Maps technology to your Microsoft Windows Presentation Foundation (WPF) application using XAML.

The Google Maps API for Flash runs as a Flash application inside the Flash player control. The Flash Player control is embedded in the WPF application and code glue allows your Native .NET C# or VB.NET code to interface for the Google Maps control in Flash.

This sample project demonstrates you how to insert Google Maps in your WPF application, how to access the Google Maps API and interface with the Maps control, and how to receive information back from the control in the WPF application.

The final application looks like this:

Best practice to store the shared folder path across the whole application


For example. The folder MEDIA_ROOT must be visible from the whole application, it stores the path of all my media files.

What is the best practice to store such a global variable.

WDP 2010 builds fail, .refresh file references not updated, dll files not copied to bin folder prio


I dont know if anybody else has seen this yet:  We use web deployment projects with web sites (not wap) and upgraded to VS2010.  When we build on our production build server (CruiseControl.Net) We found that the compile step fails because it could not find the dll files referenced in the bin folder .refresh files. 

Since the only the .refresh files are checked in, and we get a completely new copy of the source before every build, the dll files themselves need to be copied into the bin folder as part of the build.

Looking at the original source folder and the \obj folder we can see the dll files are not getting copied.

I think the problem is something in the new WebDeployment.targets file - specifically in the _ResolveReferences target.  I removed the Condition= from the Copy item and (~line 823) and it works fine now.

 <Target Name="_ResolveReferences" DependsOnTargets="_PrepareForBuild;GetRedistLists">
        <CreateItem Include="$(_FullSourceWebDir)\Bin\*.refresh">
            <Output TaskParameter="Include" ItemName="References_RefreshFile" />
        <ReadLinesFromFile File="%(References_RefreshFile.Identity)" Condition=" &#

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.
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