I'm trying to add an existing project to another project with-in my solution.
When I go to MvcProject.2 and add a new reference to MvcProject.1 and save it, it is added to the References section and the data models load up in the object explorer. Only problem I'm having is that I'm not able to do using MvcProject.1; because there's no namespace found in the project, even the the assembly reference has been loaded. Is there a step I'm missing here? I followed the instructions on here best I could, but no luck: How do you share code between projects/solutions in Visual Studio?
Check that the Target Framework values in the Properties of both projects are the same.
Inside the project in Visual Studio, right click on the MvcProject.1 reference in the References folder and choose View In Object Browser. This will load a list, expand MvcProject.1, the first child will have an icon of curly braces that is the namespace name; whatever value is there is what you can use in your using statement.
Related
I'm not able to access the playn.core.json.* classes inside eclipse even though everything else works in general. I have used this http://code.google.com/p/playn/wiki/GettingStarted in setting up my eclipse project.
However the following classes are visible -
JsonImpl
JsonParserException
JsonSink
JsonTypedArray
JsonWriterException
When I go to the referenced libraries in Eclipse, I can see playn.core.json and
can see all classes inside it. I'm just not able to use them inside my
code.
Thanks!
Just saw the samples.
You're supposed to use the interface Json.Object/Json.Array.
Use PlayN.json().createObject() to create a new Json.Object instance, and PlayN.json().createArray() to create a new Json.Array instance.
Make sure you have statically imported playn.core.PlayN.*
I have situation like this: I am doing my own mvc project in visual studio and i found example of simmilar project on the web, in solution explorer i see that it's actaully 4 projects inside 1 as you can see in picture:
So my question is how to add for example Northwind:Model to my own project, as you can see Northwind:model contains Properities, References and classes. Most important to me are classes.
[Edit]my question is about type of project to add, that is confusing me.
Also i will need all 3 Northwind.Model, Repositories and Respositories.Entity.
Thanks for answers!
Simply right click on the Solution (Grid in your case) and select Add > New Project....
This will take you to the standard New Project dialog which you just use as normal. It can be any type of project you like, but in this case you probably want a class library.
If you've got an existing project you want to include then you can do this in a similar way. You don't have to copy the source into the same directory structure but it can help. Make sure it sits under the Grid folder. Then right click on the solution and select Add > Existing Project...*. Browse to the folder containing the project and select the .csproj file.
It sounds like you want to reference projects Northwind.Model, Northwind.Repositories and Northwind.Repositories.Entity so you can use classes in your project jqGrid.
In that case right-click References in your jqGrid project, choose Add Reference... and switch to tab Projects.
Here you should see all available projects in your solution. Select the projects you like to reference and click OK.
I'm totally new to the Microsoft dev scene so please go easy :)
Currently, I have a solution that contains two projects (ASP.net websites, FWIW). If I create a class in Project1, how do I expose it to Project2? Is it automatically available to Project2 because they are in the same solution? Or do I need to do something special to make the connection?
you need to Add Reference of Class to the project
Like this:
Then Go to Projects Tab (if your project is in Same Soln) .Select the class library need to refer and click ok.
When you expand your Reference you can see the class1.dll like this
Hope this may help you :)
Go to the properties of Project2, and add Project1 as a "Project Reference".
Then your class will be available via Project1.ClassName
You can then use the Imports Project1 statement to shorten the reference, and just reference ClassName
Add a project reference. Go to solution explorer and right click on Project 2's 'References' node.
Select 'Add refrence'. From the 'Projects' tab select Project 1.
That's it. Now you can use classes from Project 1 in Project 2.
You need to add a reference to the project (context menu on the project) and add Imports statements in your class files to use objects from the other project.
Normally you would just create a reference from Project 1 to Project 2, but as they are both ASP.NET websites i don't know if that would be possible (i've never tried that particular combo).
What you can do instead if that fails is share the actual class files between the two projects - in the Solution Explorer right click, Add existing file, then browse to the file containing the wanted class in project 2, and then just before you click Add, click the little down arrow on the button and select Add as link.
I am using Adobe Flash Builder 4.
I've run into this issue with my latest project, but I was able to re-create it with an almost empty project.
Here is what I've done.
Created a new Flex Project
Created a locale/en_US folder within this project.
Added a class that extends SparkDownloadProgressBar. All this class does is attempt to create a Label.
When I try to debug this application, I get the following error.
Error: Could not find compiled resource bundle 'components' for locale 'en_US'.
at mx.resources::ResourceManagerImpl/installCompiledResourceBundle()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\resources\ResourceManagerImpl.as:340]
at mx.resources::ResourceManagerImpl/installCompiledResourceBundles()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\resources\ResourceManagerImpl.as:269]
at mx.resources::ResourceManagerImpl/processInfo()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\resources\ResourceManagerImpl.as:387]
at mx.resources::ResourceManagerImpl()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\resources\ResourceManagerImpl.as:122]
at mx.resources::ResourceManager$/getInstance()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\resources\ResourceManager.as:111]
at mx.core::UIComponent()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:3728]
at spark.components.supportClasses::TextBase()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\components\supportClasses\TextBase.as:154]
at spark.components::Label()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\components\Label.as:384]
at Preloader()[C:\SVN\Games\Social\Test\src\Preloader.as:21]
at mx.preloaders::Preloader/initialize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:253]
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::initialize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:1925]
at mx.managers::SystemManager/initHandler()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2419]
The Flex Compiler/Additional Compiler Arguments section does contain "-locale en_US", but I do not want to just remove this as I am planning to have this load different property files based on the localization region at run-time and how I understand it, I will need to add each locale that I am planning to use on the compile argument line.
I am at a loss as to how to attack this problem. If you need anymore information from me to help with this, I will be more than happy to provide it. Thanks ahead of time for the help!
This might be caused by the fact, that Preloader loads the actual framework, so you can't use the Flex's classes until it loads. Use standard TextField for it and it should work fine.
I can't seem to find any of my code behind files in the class view tab. I can see other classes that I have added but none of the code behind files. Is there a reason for this? I am missing a setting or something? It is quite irritating trying to navigate my way through the code all the time.
I can see all the other classes just fine just not my code behind files.
Class View is intended to provide a hierarchical view of the "symbols" defined in your project. For website projects, it will only list the referenced assemblies and any classes defined in App_code.
So, no, you aren't missing a setting. You're missing the point of the Class View window ! ;-) Maybe you should be looking in the Solution Explorer instead.
BTW, if you're having trouble navigating through code files, you should consider better organizing your files (in folders, for instance).
Edit (after a Bounty has been placed on this question... drool! ) :
Okay, I have VS 2005 SP1. I tried the following cases:
a. Create New Website (VB or C#):
The Class View window is blank until you add an App_Code folder. When added, the Class View window displays any classes added to the App_Code folder and the default Project references (System, System.Web, etc). It does not however display any Page code-behind classes.
b. Create New Project -> Web -> ASP.NET WebApplication:
The Class View window auto-populates with the Project references and the Page code-behind classes. This happens before I added any folder containing class files.
I am not sure if you are familiar with the ASP.NET Web Application Projects. If not, you need to have the Service Pack for VS 2005 installed. You can get it here. Else, you can also install the Web Application Projects extension directly.
Don't be placing classes other than the class backing the page in code-behind. Place all other code in a separate library project or at the very least in the App_Code folder.
There should be a drop down menu right above the code. The left on is the classes in your open file and the right are members of the selected class.
A great way to navigate code in Visual Studio is with the right-click context menu's Go to Definition and Go to Declaration options.
You could also use Reflector on your assemblies to view the class/member hierarchy in a tree.
VS 2008 improves the class view to what you want ... just saying.
Edit: Nevermind, VS2005 should do what you want as well. You can use the Object Browser as well.