Reference Assembly Outside The AppBase-Directory
Nov 16, 2009Reference Assembly outside the AppBase-Directory
View 1 RepliesReference Assembly outside the AppBase-Directory
View 1 RepliesI've got an exception when I deployed my application: "the located assembly's manifest does not match the assembly reference" What I remember is changing the project name from the previous source code, does it affect that much?
View 1 RepliesI have a difficult to reproduce error on about three user installs out of 20. This is a .net Windows application, 2005 in VB.Net running on XP. After opening up a window, we get an error:[code]This happens also for the ReportViewer dll and a couple other infragistics dll's.I turned on Bind Logging, and the first binds are ok, but when I get the error, the Appbase has been set to blank:[code]
View 2 RepliesI made my first WPF control:
[code]...
On the DataGrid control it says: "the type datagrid was not found, Verify that you are not missing an assembly refernece" I'm creating the control within a Win Forms app. What assembly to I need to include and how do I do that in XAML?
I have VS 2005. I am creating a VB .NET class that will interop with a COM app. I want to add a reference to a type lib file (.tlb). So I run the add reference command and use the browse button. I browse to the .tlb file I want and ok out. When I am done, the reference I have is to an assembly in the GAC. But I don't want that assembly as a reference. I want to have the IDE create a private interop assembly that I will deliver with my .NET object.
So how do I avoid hvaing VB .NET pull in an assembly from the GAC instead of creating an interop asm from the typelib I have browsed to?
I have a pretty complicated project with lots of class files, code modules, etc. There was a changed to one of my referenced DLLs that requires an isolated change in a single Sub within my solution. Unfortunately, this new Sub is not compatible with most of my clients' configuration but is required by some of my other clients. So now I must keep two versions in Source Safe of my solution - which I do not want to do. What I would like to do is to be able to determine which DLL is running and flip a switch to use the either the old Sub or the new Sub. Currently the sub is in a class, but I could break it out. Is it possible to determine which assembly version DLL is running? Also, if I reference the new DLL, the old Sub will not build. If I reference the old DLL, the new Sub will not build. So is there a way to keep both Subs in the same project?
Can I use reflection to know what is the assembly version of a loaded DLL?
I have created a shared assemby MyLibray version 1.0.0.1 and installed it in gac. Again I created MyLibrary version 1.0.0.2 and installed it in gac.
See the gac screen shot.
But in Add Reference dialog box only older version 1.0.0.1 is available.
See the screenshot.
I have an industrial control program that we install on OEM equipment. This equipment falls into one of two categories; those WITH a special piece of IO hardware installed on the computer and those without.
This IO hardware has .NET 3.5 support assemblies, and is easy to program for. In my program, I reference the assemblies under the Project Properties and I'm good to go. Here's my problem... my program now seems to NEED this assembly to even start up, even if I'm not directly accessing anything in it until much later in the programming. When we ship any version of this equipment; I need to install the IO hardware assemblies whether the equipment needs it or not just for my program to run. The assemblies are bundled onto a hardware driver disk, and this sucker is 3gig.
What I would like to do is alter my program so that it runs no matter if it finds those assemblies or not. If not, then it will automatically close off certain functionallities (you can't use that because your computer don't have the hardware installed); and ideally, Visual Studio won't have 100 errors about a "missing reference". If found, then it will call them and use them normally as the program currently does.
I have a pretty complicated project with lots of class files, code modules, etc. There was a changed to one of my referenced DLLs that requires an isolated change in a single Sub within my solution. Unfortunately, this new Sub is not compatible with most of my clients' configuration but is required by some of my other clients. So now I must keep two versions in Source Safe of my solution - which I do not want to do. What I would like to do is to be able to determine which DLL is running and flip a switch to use the either the old Sub or the new Sub. Currently the sub is in a class, but I could break it out. Is it possible to determine which assembly version DLL is running? Also, if I reference the new DLL, the old Sub will not build. If I reference the old DLL, the new Sub will not build. So is there a way to keep both Subs in the same project?
View 1 RepliesI have managed to get ASP.NET Membership mainly working with my SQL server.The problem i'm having is I get an error in VS2010 in my code behind file when attempting to create a user. I get a Red Exclamation mark appear on .CreateUser on the code below.
Error Message:Reference required to assembly 'System.Web.Security.ApplicationServices, Version=4.0.0.0, Culture=neutral,PublicKeyToken=31bf3856ad364e65' containing the type 'System.Web.Security.MembershipUser'. Add one to your project.
Code:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Membership.CreateUser(r_user_name.Text, r_password.Text)
Label1.Text = "User created"
[code]....
I've tried adding the following to the web.config:Not sure if thats correct!! but i get an error message when I open the page:Parser Error Message: Could not load file or assembly 'System.Web.Security.MembershipUser, System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e65' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
How to I reference my own .dll after i add it to the GAC? I successfully added my .dll to the GAC, have seen it in the list. However, when i try to reference in Visual Studios..... i am lost.
View 2 Repliesim building an application i started it in VB 2008 and i upgraded to VB 2010
then i made some mods and tryed to run the application and then
i get this error
Error2Reference required to assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' containing the type 'System.Windows.Forms.Form'. Add one to your project.C:UsersAdminDesktop
[Code].....
Currently, when I want to use Microsoft Chart Controls on a website, I need to add the following onto every aspx page where I want to use it:
[Code]...
Is there any way to move this to the web.config file, so that I don't have to put it on every page ?
I have a Visual Studio 2008 solution with project A referencing project B as a project reference. Project B references System.Data.Linq, but project A does not. Everything compiles and runs fine. I like this arrangement because avoiding a reference to System.Data.Linq in project A ensures that it uses project B methods instead of directly accessign System.Data.Linq methods, which I want to avoid.
View 3 RepliesWe have upgraded our project from Visual Studio 2008 to Visual Studio 2010 without any issues until now. Our project contains a folder call Libraries which contains different versions of Oracle ODP.NET DLL's as well as different versions of Telerik DLL's. Our project contains references to one of the versions of each. The problem is once we remove the reference and re-add it by browsing to the new version, again inside the Libraries folder inside the project, it adds the reference, but to the same version we just removed. We can even copy the DLL to our desktop, remove the reference and add to the new one on our desktop and it still will point to the Libraries folder version???. The only we we can actual change the reference to the new DLL is by manually changing the path in the .vbproj file, which is obviously not going to work for us. The same behaviour worked perfectly in VS 2008. We switch our references quite often, when new versions come out, but also far more often to QA different versions of ODP.NET and Telerik Control DLL's, so manually editing the .vbproj file is becoming quickly cumbersome. If I browse to a specific version at a specific path, Visual Studio should ALWAYS do what I'm telling it to do..
I did some seaching and came across a few other people with the same issue. This better not be as designed and if it's a bug, which I believe it to be, when will it be fixed?[URL]..
When I try to compile my VSTO Outlook addin, I get this error:
Reference to class 'RibbonBase' is not allowed when its assembly is linked using No-PIA mode
I have Visual Studio 2010 and a VB Project that had a reference to Microsoft.Interop.Excel 12.0. Well recently I changed the reference version to 14.0. That was actually a mistake and now I need to bump it back down to version 12.0. However I get this error in my project now...
Project 'MyProject' requires a reference to version '14.0.0.0' of assembly 'Microsoft.Office.Interop.Excel', but references version '12.0.0.0'
of assembly 'Microsoft.Office.Interop.Excel'.
I tried removing references and adding the com object to, but no avail.
I am after the one which is most used. A number of ones I have come across are:
CurDir
Environment.CurrentDirectory()
AppDomain.CurrentDomain.BaseDirectory
Application.StartupPath (this one doesn't work for me, missing a library?) I am using it to save a file, for argument sake, "test.txt"
I'm making a Windows Forms application and I am about to publish it to a ClickOnce to distribute on a CD. The program refers to a LOT of files, e.g. pictures, which I have in a folder on disc called GAMEFILES. It's in the Solution Explorer. That folder does itself have a lot of subfolders. (I'm sort of a tidiness freak.)[code]...
View 3 RepliesWe are trying to write an application that uses the NServiceBus library in a VB.NET environment. We've been stymied by errors similar to the following: Reference required to assembly 'NServiceBus,Version=2.0.0.1071, Culture=neutral, PublicKeyToken=9fc386479f8a226c' containing the implemented interface 'NServiceBus.IMessageHandler`1'. Add one to your project.Our project already includes references to NServiceBus.dll and NServiceBus.Core.dll from the same NServiceBus 2.0 RC2 distribution.
[Code]...
Any ideas about how to solve this problem? (And, yes, my preferred solution is switching to C#, but no, that's not an acceptable one at the moment.)
MY understanding is like this, for the "website type" of projects:for VB, the default setting for the namespaces and the default setting for references are both stored in C:WindowsMicrosoft.NetFrameworkV4.0.30319ConfigWeb.config.
but C# does not seem to use this global web.config file to store its default namespaces and references settings. One evidence is that you see a lot of "using ..." statements at the top of all C# files whereas you don't see many "imports ..." statements at the top of all VB files. So C# stores the namespace settings in individual .cs files, but where does C# store the reference settings then? Or the C# compiler knows all the reference without having to store it somewhere?
i compiled 1 control in vb6. now i'm trying use it in vb2010, but i recive 2 warnings:
"Warning1A reference was created to embedded interop assembly 'stdole' because of an indirect reference to that assembly from assembly 'AxInterop.Sprite'. Consider changing the 'Embed Interop Types' property on either assembly.WindowsApplication1" and "Warning2 reference was created to embedded interop assembly 'stdole' because of an indirect reference to that assembly from assembly 'Interop.Sprite'. Consider changing the 'Embed Interop Types' property on either assembly.WindowsApplication1 "why these warnings? (i have sure that in vb6 don't give me any errors)
I'm looking to add reference object libraries relating to excel and none are available to select from my directory. I have Microsoft Office Excel 2010 Express installed. Where can I retrieve this object library (and others?). Looking to import and export data to/from excel.
View 7 RepliesI can reference the local (generic) data directory for an SQL file as follows:
Dim
T01Database As SqlCeConnection =
New SqlCeConnection("Data
Source=|DataDirectory|Test File.sdf")
I get a "file not found" error when trying the same syntax for referencing an Excel file:
Dim
T01Workbook As Microsoft.Office.Interop.Excel.Workbook
= T01Application.Workbooks.Open("|Data Directory|Test File.xlsx"
)
correct syntax for referencing an Excel file in this manner?
"Warning1Could not resolve this reference. Could not locate the assembly "Dotnetrix.TabControl". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors." and i have no idea how to fix it. i need to use the dotnetrix.tabcontrol.dll for what im trying to do, but i can't build the program. i can debug it though. haha i am a complete newbie to visual basic but this seems to be my only problem so far.
View 8 RepliesWhen running setup to install published program, the following message occurs: System Update Required: Unable to install or run the applicaiton. The application requires that asssembly CrystalDecisions.CrystalReports.Engine Version 10.2.3600.0 be install in the Global Assembly Cache (GAC) first. This version is listed in the references of the program and in my mind, be included in build. How do I get by this error?
View 23 RepliesWhen running setup to install published program, the following message occurs: System Update Required: Unable to install or run the applicaiton. The application requires that asssembly CrystalDecisions.CrystalReports.Engine Version 10.2.3600.0 be install in the Global Assembly Cache (GAC) first. This version is listed in the references of the program and in my mind, be included in build. How do I get by this error?
View 2 RepliesI have recently upgraded an VB6 project to vs2008. I was almost finished when the following error occured. Unable to emit assembly: Referenced assembly AxInterop.MSFlexGridLib does not have a strong name Prior to this error appering, I tested my app several times and it was fine. Only after publishing it did the error appear. I have tried all solutions I could find, but nothing helps. I have read [URL]
View 1 RepliesI receive this error as "Assembly Load Error" whenever adding a form or other object that has to be inherited.
"Unable to load assembly. Ensure that the file is a valid .net Framwork assembly"
I am loading an Assembly using Assembly.LoadFrom() as the assemblies are located in a different path from Application Base directory.
Dim oAssembly As Assembly = _
Assembly.LoadFrom("C:\MyFolder\" + ddlXlate.SelectedItem.ToString() + ".dll")
And I consume a Type from that assembly without any problem:
oXML = CType(oAssembly.CreateInstance(sBaseType + ".XlateContainer"), _
XlateBase.XlateContainer)
However, the problem occurs when I try to use a Type from this assembly from within another method like the one below:
oComboBox.DataSource = _
[Enum].GetValues(Type.GetType(sType + "+ItemEnum," + sAssemblyName))
sAssemblyName is the one I loaded using LoadFrom() actually. After it said it cannot find the assembly, I used AssemblyResolve event which solved my problem :Subscribing AssemblyResolve event :
AddHandler AppDomain.CurrentDomain.AssemblyResolve, _
AddressOf MyResolveEventHandler
Event Handler Method:
Private Shared Function MyResolveEventHandler(ByVal sender As Object, _
ByVal args As ResolveEventArgs) As Assembly
Return Assembly.LoadFrom("C:\PSIOBJ\" + args.Name + ".dll")
End Function
And I thought maybe the error occurs because it cannot find a dependent assembly defined in assembly manifest file I loaded using LoadFrom() already but when I checked the args.Name, I saw it was trying to load same assembly and after that it worked without any problem. So basically a type in the loaded assembly cannot be found before the event adding change.
My old code was using AppDomain.CurrentDomain.Load() and Assembly.Load() methods and they were working fine without the AssemblyResolve event. I was able to reach types in dynamically loaded Assembly from every where within the same AppDomain.
LoadFrom() can find dependencies automatically within the same requested assembly path and that couldn't be problem as everything this dll needs was there. So at first it looked like a AppDomain problem to me as it looks like it seems it can reach assemblies from Load context instead of LoadFrom context and I am now using LoadFrom context.But now it seems I should pass oAssembly instance evertwhere to use any type from the loaded assembly?Doesn't it load the assembly where I can reach it everywhere (same AppDomain) using simple Type.GetType(...) method?