Could not load file or assembly System.ServiceModel [duplicate] - c#

This question already has answers here:
System.ServiceModel not found in .NET Core project
(4 answers)
Closed 4 years ago.
I recently started converting an ASP.NET web application to ASP.NET Core.
I was earlier making use of System.ServiceModel for WS2007HttpBinding and System.IdentityModel, however in ASP.NET Core I get the following error:
Could not load file or assembly System.ServiceModel
Is System.ServiceModel deprecated for ASP.NET Core or is there an alternative workaround for it?

You can download it from NuGet the specific package if you are just trying to reference the WS2007HttpBinding

Related

How is .Net Core 5 application organized/structured ? or how to add n-tier class library projects to .Net core Asp.Net solution? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am trying to convert one of my simple Asp.Net MVC application to .Net Core. So I am trying to understand how the .Net Core Asp.Net application is organized or structured.
I understand .Net Core is not ready for Production yet. The .Net Core documentation is for most of the part not written yet (hence the curiosity).
Availability of Asp.Net 5 Beta8 was announced recently. I tried getting dnvm and dnx working on mac, there are some issues with Beta releases which get resolved after some persistence.
Now, generally we organize our .Net solution somewhat like this:-
MySolution.Core.sln
\MyProj.Web
\MyProj.Core
\MyProj.Domain
\MyProj.Service
\MyProj.Data
\etc...
So while trying to migrate the Asp.Net project to .Net Core, we wish to maintain the similar structure as above. The Your First Asp.Net 5 Application on Mac didn't really present me with any much of real life application as such. Moreover, taking inspiration from here and here, I've noticed the following structure of the application:-
MYFIRSTAPP
\src
\MyFirstApp
\bin
\wwwroot
\css
\images
\js
\lib
_references.js
\Controllers
\Views
\ViewModels
Startup.cs
project.json
hosting.ini
global.json
In project.json we define our dependencies.
So my question is, is the above structure the standard for .Net MVC 6 application? and how to add the other layers[Core,Domain,Service,Data] or class library projects to above application?
This is where I got the answer from:-
Upgrading ASP.NET 5 Projects between Beta Versions
How n-Layered Asp.Net 5 application is structured is available on above blog. Rick Strah's VNext sample project (AlbumViewerVNext) is located here:-
AlbumViewerVNext Github Repository
All thanks to Rick Strahl for his awesome blog and his sample projects.
Not sure what your question is because you seem to already have the answer but here's a potential answer:
The solution structure should be similar to what you had before in ASP.NET Pre-5. Use class libraries for different layers and you can keep the existing structure.
The only major difference in terms of structure is the wwwroot folder that I see that you've already included.
Update to the OP comments:
The class libraries will be packages too.
Here's an example of a class library written using DNX. Then you can reference that class library in project.json as shown here.
The source code can live in any folder you decide and then you can use global.json to include those folders in the search path like here: https://github.com/aspnet/Configuration/blob/dev/global.json

How do i target my old website from .NET 4.5.1 to 4.5.2 [duplicate]

This question already has answers here:
Configuring .NET Framework 4.5.2 in IIS 8.0
(2 answers)
Closed 7 years ago.
I have an old website, it is not web application so there is no properties window to target the .NET Framework to 4.5.2, how do I modify the web.config to target .NET Framework 4.5.2?
I need to know that it uses .NET 4.5.2 because I want to test whether the application is compatible with it before deploying to production
Right click on the web project and select the Application tab on the left. There is an option for Target Framework: It will probably be set to 4.5 or 4.5.1. Change it to 4.5.2 and repeat for any other projects in the solution.

Reported version number of aspnet is unexpected [duplicate]

This question already has an answer here:
Version Information on ASP.NET Server Error Page
(1 answer)
Closed 7 years ago.
I am implementing an MVC 5 website in C# (VS 2013 update 4) and the build setting is targeting .NET framework version 4.5. However when I load the page, I see the following header entry:
X-AspNet-Version:4.0.30319
Why is the website running under .NET 4.0xxxx despite the compile setting is pointing to .NET 4.5? Any ideas?
Thanks in advance.
That is not the actual .NET framework version. It is the version of the CLR.
From .NET 4 up to 4.5.2 it is version 4. Between 2.0 and 3.5 it was version 2.0.
That is also the reason that in your application pool configuration you can only choose .NET 2 or 4.
See MSDN: .NET Framework Versions and Dependencies on this matter.
https://stackoverflow.com/a/25632090/511418

Converting project to.net 4.5.1 [duplicate]

This question already has answers here:
How do I change the .Net Framework from version 3.5 to version 4.0
(5 answers)
Closed 8 years ago.
I am working on a solution which contains multiple projects. it's working on .net version 4.5 and now my PM asked me to convert the solution to .net 4.5.1 and merge it back into the source code. can any one help me how to covert the my current solution into .net 4.5.1
Go into the properties window for each project and change the Target Framework to 4.5.1.

WPF Project cannot find system.web Assembly [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How do I add System.Web as a reference if I cant find it in the list of references?
I am developing wpf application.
I am using one of the system.web class called HttpUtility.
I am not able to add the reference.
Thank you.
You can adjust your Target Framework to .NET Framework 4.

Categories