Referencing DBML project in Console App (.net) - c#

I inherited a software engineering job with a .DBML project in it. It was being referenced by an ASP.Net website as it's data access layer, but I'm tasked with creating a Console app that could utilize the extensive data access classes in the project.
However, when I reference the project I get intellisense and all but on building it, get errors as if I don't have reference to it.
I am not that familiar with this kind of project and am kind of at a lost how to proceed. I have been trying out different stuffs for past few hours, but nothing seems to work.
Can anyone guide me to how to solve this, or perhaps an article that could point me to the right direction? Thanks!

Right click on your console application and then click on properties. Change the target framework from .Net Framework Client Profile to .NET Framework.
This "feature" of Visual Studio has bitten a lot of people... I wasted almost a full day on it recently.

Related

Merge Visual Studio Solution into Gitlab

I have a local Web Application which's backend is written in C# with Visual Studio. Now I decided to use a source administration tool for it. My problem is, that I'm really confused how to migrate my solution into GitLab. In my opinion there is one solution and 6-8 projects in this solution. So I wanna try to create for each project a git repository. The only problem is, that if I'm cloning my projects they won't find the dependencies. What is the right way to check in everything, organize it right and get rid of dependencies problems?
In the moment I created a git subgroup "MYAPP" and added all angular frontend applications. I made one repo for every application. Now I want to add the c# projects which are containing the logic. These are devided in 5 projects and a core project which handles the entityframework.
I hope to get some good advices and best practices.
Sorry for my bad english and thanks to everyone who tries to help.
You should consider carefully if you want to separate each project into a single repository. If your projects are only used as part of your solution and you never want to use them anywhere else as standalone modules or libraries, it's perfectly fine to put the whole solution and all projects in a single git repository.
If, on the other hand, you use or publish your projects as libraries, you can totally manage them as separate repositories. In this case, you would need a repository for your solution that includes your subrepositories as submodules or subtrees.
Managing subrepositories, however, always comes with a certain overhead. I would advise to avoid it if it isn't justified (i.e. if at this point in time your solution is the only one using your projects).

Error while building C# project in VS Community (Dependancies Exchange)

This is my first question here. I'm working on a Windows 8.1 with Visual Studio Community (Update 2). I'm building a small service in C# for my company that parses emails from an Exchange web service. In my solution, there are 2 projects: one built from scratch where I create the service and deal with emails, and the other one is a "Visual Studio Installer" that creates a small .exe to install the service with with all its dependencies.
The first project uses Microsoft.Exchange.WebServices.Auth and Microsoft.Exchange.WebServices libraries to communicate and parse emails from an exchange web service. These two dependencies are coming from NuGet. Both projects are built with the 4.5 .Net Framework. The installer has one main output which is the service project and has 4 dependencies:
Microsoft .NET Framwork.dll
Microsoft.Exchange.WebServices.Auth.dll
Microsoft.Exchange.WebServices.dll
System.net.HTTP.dll
The service works pretty well and I'm happy with it. I tried to update my code this week to see how I can write in the Windows journal. The issue is that since this week (30/05/2016) I can't regenerate my solution. I can build the first project (service one) and there are no issue but for the second one (installer), 4 warnings show up (both appear twice in DEBUG mode and 3 times in RELEASE mode):
WARNING: Unable to find dependency
'MICROSOFT.IDENTITYMODEL.EXTENSIONS' (Signature='69C3241E6F0468CA'
Version='2.0.0.0') of assembly
'Microsoft.Exchange.WebServices.Auth.dll'
WARNING: Unable to find dependency 'MICROSOFT.IDENTITYMODEL'
(Signature='31BF3856AD364E35' Version='3.5.0.0') of assembly
'Microsoft.Exchange.WebServices.Auth.dll'
These warnings explain the fact that the installer don't appear anymore in the DEBUG and RELEASE folder. I reverted the code I wrote and the error is the same. I also tried to create a new solution with the same project as 4.5 Framework basis and with an empty project but with the same dependencies I have the same warnings.
Do you guys have (had?) the same warnings?
I found a solution to my problem. My solution was saved directly on a remote hard drive. When I built the soution, .net framework was not found (my error). I re-create localy my solution and it works. Hope it will helps others.
Perhaps, I don't know why from one day to another .net was not found. Maybe Windows update has crashed during an update.

Update one DLL file in an ASP.NET website project

net development. I am working in a website project and I am trying to update one of the dll files. I've search for hours for a solution on stackoverflow, but no luck.
Our website project in Visual studios is composed of one website that uses three C# projects. I am trying to update just one of these C# projects. Currently the website is in production and the DLL files of these projects are in the /bin folder.
I opened up the solution in VS and made my changes.
I built the whole solution and retrieved the new dll.
I stopped our in-process website with IIS and overwrote the dll and restarted it again.
I get an Missing Method Exception as an error when I do this. I was hoping for a straight forward way of updating our website project because I only need to change about two lines of code and swapping dll files seems like the easiest way of doing this.
Thank you guys for your help and be patient with me I am a slow learner and I ask a lot of questions.
One of the reason of this to occur could be that your dll is built using different version of .net framework than what is on your server. You can check that and see if that resolves the issue.

Setting and configuring a subversion repository for my .net project

I am developing a ASP.net project in visual studio.
Every thing was fine when I was the only developer here, but I needed some helping hands to contribute to my project.
Currently there are 4 developers not in a same geographic location.
So after the files are changed and submitted to me, a lot of effort and time is wasted in merging the code.
So I was thinking of creating a subversion of this project.
I have worked with SVN through Tortoise, but I have not done the set up.
Please suggest me a way to set up an SVN.
Any suggestion will be appreciated.
Thanks in advance.
First thing you need to decide is the hosting space for your code.
If you are developing an opensource project, then you can go for code.google.com or any other provider. If your project is private, then you can coose any private repository such as assembla. If you go in this way, you will get a checkout url. You can just commit your project to this url.
If you are having your own server to host the code, then follow the steps provided in this article.

Trouble running the WPF Application Framework examples

I feel embarrassed asking this here, but I was wondering if anyone could help me quickly, the Microsoft documentation around this is actually quite poor.
Microsoft host what appears to be a very neat framework on codeplex that helps you build MVVM WPF applications, and has samples illustrating much of the MVVM principles and the supporting code base they offer. It's called WPF Application Framework and you can download it here.
I downloaded the framework and its samples, as well as the documentation for the sample i'm interested in (WPF EmailClient), but I'm having trouble running the sample.
This is a picture of the documentation:
As you can see, it tells you to simply set the EmailClient.Presentation project as the startup project and run.
However
This project is in fact a Class Library, and cannot be set as a startup project.
I turned it into a Windows Application, but it needs an App.xaml file, and the whole project seems to use MEF as an IoC container and dependency injects all the views and ViewModels dependencies.
All this means a lot of work for me to launch this project, and I was just wondering if any of you out there know how you are supposed to do this.
Oh yea and I'm running windows 8 and VS2012, but I really don't think that has anything to do with it. (The project is targeting .Net 4 anyway)
Interesting framework.
The application for the overarching "InformationManager" sample is a project called "Assembler"
You'll need to set this as the startup project. Make sure you do a full build of the entire solution before you run it, otherwise you'll get an xaml parse exception in app.xaml.
By changing the project type you broke the solution. Download the example again and open the solution in Visual Studio. Next right click on the project you run and select Set as Startup Project.
Then when you press F5 it'll launch that application, not the class library.

Categories