Error getting when adding reference of service class in console(.exe) - wcf

Getting error
A reference to "file path\file.sln"could not be added. please make
sure that the file is accessible and that its is a valid assembly or
COM component

You mean adding a reference inside a project?
If is this, you canĀ“t add a reference to a whole .sln, you will need to choose, for example, a valid .dll of the service you are trying to reference.

A reference to "file path\file.sln" could not be added.
That's a solution file.
[...] and that its is a valid assembly or COM component
A solution file is not an assembly or a COM component, hence the error. You need to add a reference to an actual assembly. If it's a project in your current solution, add a Project Reference. If it's not in your solution (and for whatever reason can't be added, though I highly recommend adding it if at all possible) then you'll need to add a reference to the compiled .dll of the referenced project.
You can't add references to solution files, project files, anything like that. Those are just XML metadata about projects. You need the compiled output, the assembly.

Related

Rename class in external dll without losing reference to it in unityEditor

We've got a visualstudio solution with all our code in it and it's completely seperated from our unity project.
When we build our code into a dll from within visualstudio, the dll is copied over to the unity project plugins folder, so we can use the classes from it in our unity project.
This all works fine, but the problem is when we rename a class in our visual studio solution, rebuild the dll and go back to the unity project, the reference to the renamed class is lost in our scene and/or prefabs...
I looked into the scene & prefab files and noticed the references to the classes in the dll are defined as follows:
m_Script: {fileID: 698634159, guid: aa20b9c3579870b40bb96d13672546a3, type: 3}
I read on the forums that the fileID is generated based on the namespace & name of the class file, so logically when the class is renamed, this fileID changes and unity does not know it needs to reference the renamed class.
Is there a way to define a hard references of some kind, so the reference does not get lost when renaming a class? Or any other suggestions to keep references from getting lost.
I've also tried including a meta file with a guid in the dll, but unity does not seem to take this meta file into account, as it always uses the guid of the dll together with the generated fileId.
Unity can't automagickaly find out you have renamed some class inside the DLL. That's true for any form of project : if you depend on some DLL, and classes changes in the DLL, there is no indication of rename.
The best way to link them is adding your Unity project in the solution, and place a dependance between Unity project and the another. Then maybe the refactor tool will suggest you the rename in the Unity project.
Here is a really good tool to find and replace missing scripts, which i assume is the error you are getting.
http://daikonforge.com/forums/resources/fix-missing-scripts.3/
It comes with the source code once you unpack the Unity3d Package, so you can customize it to your needs.

DLL reference not working in Visual Studio VB?

So I have a fairly simple application that i found originally in C# I converted it to VB and everything is working perfectly find all the system references are working fine but this one DLL (gameserverinfo.dll) is not being found. I have re-added the reference in Project > Add reference and I have also changed the location of the dll and still no go. I'm not sure why it is having an issue as i have referenced it in other projects and had no issues. And thoughts?
You are probably missing a namespace. Try importing the namespace at the beginning of the file, fully qualifying any method/classes, or adding a global import statement from the reference page of the project properties.

MVC - Application Assembly

Question:
If I have multiple projects in one solution is it still considered a single assembly?
Background Information:
I'm aware the 'MyApplication/Properties/AssemblyInfo.cs' file exists. Further, I confirmed that when I:
Add a project to the solution.
Appropriately reference the newly added project.
Lastly, Build the solution.
The 'MyApplication/Properties/AssemblyInfo.cs' file has not changed. This leaves me to believe, and please correct me if I'm wrong that I'll have met the demand.
Thank you
No.
Each project is compiled into one assembly in your case. The assemblyinfo.cs file (for each project) should not change at all when you compile anything. Also, that file's name is not important at all; it's the global attributes inside it that cause various properties of the assembly being created to be set. That file's name and location are simply a convention.

What DLL file do I need to add to my solution to use DbSet?

I am trying to use the generic DbSet class. I have tried adding the following references so far to my solution because the MSDN documentation states that DbSet lives inside System.Data.Entity:
However, as shown below I still cannot add a reference to System.Data.Entity, the only suggestion intellisense has is EntityClient which does not contain DbSet:
Resharper/Intellisense is not giving me any other suggestions of namespaces I could possibly add.
I have tried cleaning and rebuilding my solution, and I am using the .Net Framework 4 full version (not the client version).
I have tried using NuGet to search for EntityFramework and have found one result which I have added to no avail as is show below:
What DLL file do I need to add to my solution to add a reference to System.Data.Entity and use the DbSet class?
Thanks
The same MSDN reference page that you mention says that you need to reference EntityFramework.dll in your project.
Note that namespaces and assemblies are not the same thing. The following statement is a little over-simplified, but you can think of namespaces as residing inside (or becoming available by referencing) an assembly.
So, once you've referenced the assembly, you will still need the using System.Data.Entity; directive.

When adding a reference in a VS2008 C# form project, does Visual Studio copy the referenced assembly

into the project directory? Or does it simply reference the dll where it exists?
My assumption was that when you compile, it copies to dll into the local bin/debug(release) directory.
I am running into some issues with a project at work involving missing third party component dll's and I am a little confused, so I'm not sure how to proceed.
Thanks,
Kevin
By Default, If it is in the GAC, then it will not copy the assembly locally. If it is anywhere else, it will.
If you have any doubt, look under your references list and go to the properties of the assembly in question. There is a "Copy Local" property. If you change that property, it should copy to your output project. Redo your packaging and deploy.
A reference has a property named 'Copy Local'. If this is set to true then the assembly will be copied to the output folder.
It'll copy it if you tell it to in the properties for the reference. Indirect references (i.e. when a third party control needs yet another 3rd party control that isn't referenced) won't be, but I think you get a compiler warning if that is the case.