LINQ2SQL installed but LINQ To SQL Classes missing from "Add New Item" list in Class Library Project - linq-to-sql

I have VS 2017 Solution with Linq2SQL projects (with .dbml) files in them. When I add a new Class Library to the solution, and do an "Add New Item" in that project, the Linq To SQL Classes option is missing. It is present if I click on other projects in the solution. How do I add new LINQ To SQL Classes to my new Class Library project?

So of course just a few minutes after I post this question I'm crawling through raw, unloaded Project files and realize I had added a "Class Library (.NET Standard)" instead of a "Class Library (.NET Framework)". The missing classes are available in (.NET Framework).

It looks like you haven't installed this component yet. It's best to install it this way:
Open Visual Installer and go to:
-> More -> Modify
After appear Modify window click on Individual Components tab. Then in the Code tools category check LINQ to SQL tools and install it.

Related

How can I access Gtk# widgets in code in MonoDevelop?

First, I am new to Monodevelop and Gtk# (but have experience with Visual Studio, C# and Winforms).
In Monodevelop I designed a form by dragging widgets onto it. I entered a value for the Name and (the same or a different value) for the MemberName. However I can't access the widgets in code.
In Visual Studio there is a form.Designer.cs which contains the code that creates the controls. What is the equivalent in MonoDevelop? I would like to examine the code so I can learn from it, and to find out how I can access a widget in code.
I am using MonoDevelop 5.5, Mono 3.10.0 on Linux Mint 17.1 64-bit.
(This question has been asked before, but that answer doesn't help me).
The GTK# generated code will be in a .cs file inside a gtk-gui directory inside your project. The .cs file will have a similar name to your widget class name but will have the full namespace of the class as part of its name.
MyWidget.cs
gtk-gui/MyGtkApp.MyWidget.cs
Also you will need to compile your project before the code is generated. The new member names should be available from within the widget's class.

Found conflicts between different versions of the same dependent assembly.MVC3 -> MVC4 / EF4 -> EF5

The question is how to resolve conflicts between versions of assemblies in my project that was upgraded to MVC4 and EF5?
The problem is manifest in the fact that my controllers and models can include System.Data.Objects, but now my views.
I am using MVC 4, my project was upgraded from MVC 3.
Entity Framework is version 5.
I have a controller that is able to use objectcontext from System.Data.Objects.
My Usings:
using System.Data.Objects;
using System.Data.Entity;
When I try to include the using in the view form System.Data.Objects, I get :
CS0234: The type or namespace name 'Objects' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
I am targeting .net 4.5
My Build Displays this message:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1561,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.
You can build your solution in diagnostic mode to get more detailed information about the error.
Open the VS Options dialog (Tools > Options), navigate to the "Projects and Solutions" node and select "Build and Run". Change the MS Build project build output verbosity to Diagnostic.
Have a look here.
If you look at the build message, it states the 4.0 version of the .net framework is referenced... Is there a setting in your project file or web/app.config specifying a conflicting version of the .net framework?
Are you familiar with fuslog? you can set it up to log all assembly bindings that .net is doing while running your application. You should then be able to see detailed information on what is getting bound when. If you still can't figure it out, you can always do a binding redirect on that .dll in the web.config.
http://msdn.microsoft.com/en-us/library/eftw1fys.aspx -- binding redirects
http://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.71).aspx -- fusion log viewer
Set up fusion logger and take a look at what the output is. If you don't get an answer from that, try the binding redirect (which would give you at least a temporary solution).
In the directory I was publishing to, there was a folder named aspnet_client. I moved it (instead of deleting it), republished, and it worked. I'm not sure why that folder decided to give me trouble out of the blue.

How to set up visual studio to create CSHTML files in (Umbraco) Project

So, i'm developing my razor macroscripts in Visual studio for my Umbraco project.
Everything is working fine, but there are two things really annoying.
If I want to make a new CSHTML file the best solution for this is to duplicate an existing file.
I dont have full razor IntelliSense like e.g. Html.Raw
Is there a way to configure my project to use this features? Didn't find a .cshtml template yet.
You need to have the MVC Framework installed, then when you open the project as a website, you should be able to create and edit cshtml files with syntax highlighting. See my answer to the following post for more details:
Setting up local development environment for Umbraco
If your project is a web site/application then the mvc templates aren't available (they only show up in MVC projects). You can just create a text file and name it with the .cshtml extension though (you could set up your own template for this in VS if you wanted to).
To get intellisense in your Razor files, see Doug Robar's blog post on the subject
As an alternative if you go into the Umbraco admin, go to the 'Developer' section and right click on 'Scripting Files' you can create razor scripts directly (and this will save the new .cshtml directly into your 'macroScripts' folder - although in VS2010 you will need to right click on the new script and choose 'include in project').
Also this will allow you to base your new razor macroscript on one of the pre-built snippets so you may get a bit of core functionality for free.
From Umbraco 6 on it's very convenient to install Umbraco on your local file system with Visual Studio and NuGet. Given that you have the MVC Framework installed and you use Visual Studio 2012 or above, you get full Razor support in Visual studio.
Umbraco Our has a great blogpost about this where they described the steps below in detail (with screenshots!).
Create an Empty Web Application.
Install Umbraco using Manage Nuget Packages ('Umbraco CMS') or the Package manager console (Install-Package UmbracoCms)
NuGet will then download dependencies and will install all of Umbraco's files in your new solution. During this process it will ask if it is allowed to overwrite your web.config file. (Make a back up of your existing web.config if you install Umbraco in an existing project)
Finally, don't forget to run your project hitting F5. You'll see that whenever you try to add or edit a file in your views folder you have razor support and intellisense

Adding an external jar library to Intellij IDEA

I'm having a silly problem : I'm trying to add the Jsoup library (which is just an external jar) to my android application developed in Intellij Idea and it seems and don't do it right .
I put the library in the libs folder , then I went in Project Structure -> modules and selected dependencies , select add global library , select attach source and click ok.
When I write code it is able to automatically import classes and to compile , but when running I get " java.lang.NoClassDefFoundError: org.jsoup.Jsoup"
Copy the .jar file into your lib/ directory.
Right click the new .jar in the lefthand file browser in IntelliJ / Android Studio
Choose "Add as Library..."
Voila!
-Open the External Libraries node on the Left hand panel.
-Select Open Library Settings
-Project structure dialogue opens up.
Select the Libraries.
Click the "+" to browse the file.
![add external jar1
In IntelliJ IDEA 15 you can also access the Project Structure menu item from "File" item in the menu bar. Select Libraries from the list on the left. Click the "+" to browse the file, select it and you're done. It will be added to the "External Libraries" directory in your project.
Have a look at the newer artifacts section. Perhaps you don't add the JAR into your deployment properly.
UPDATE:
I'd like to update my answer based on lessons learned over the past six years since I first answered this question.
The best way to manage 3rd party JAR dependencies in Java projects is to learn Maven (my preference) or Gradle. IntelliJ has terrific integration with both.
If you combine those with an enterprise repository like Nexus you'll have no problems. Your dependencies and versions will be completely specified. Conflicts will be identified for you. Updates will be relatively simple.

Is it possible to create "Empty Solution" with Visual Web Developer 2010 Express?

s it possible to create an "Empty Solution" with Visual Web Developer 2010 Express? It looks to me like that was possible to do so with VWD 2008 SP1 Express.
Anything to configure to get an empty solution? Or something similar, so that I can get more than one solution for a new application? I've VS2008 professional and I'd like to switch to VWD 2010 Express before I'm able to get VS2010 Professional edition.
Thanks for helping
First, identify a folder location in which you will build solutions.
Then in VWD 2010 Express, create a New Project from the File menu. Select the Windows templates under your preferred language (ie C#) and highlight Class Library. Name your Class (ie, "Domain") and below that you have options to set your base directory for the solution folder, 'Create new solution', and provide a 'Solution name' with the 'Create directory for solution'.
You can then use the File -> Add... menu option to add resources to the your solution.
I came into this problem myself
If I understand you question right this is what you want to do.
Go to File -> New Project -> (under Installed Templates) click and expand desired language (VB or C#) -> click on Web -> and to the right go down to ASP.NET Empty Web Application. That will create the necesary Properties, References, and the Web.config files.
Then just click on File -> New File... -> Click on desired language -> Click on Web -> and select what you want you include. in your case a Web Form.
That is it.