I need to move my projects from .Net Framework 4.7.2 to .Net Core platform, and I have difficulties to resolve the problem with code in part of using SHDocVw library.
I have such string of code:
using SHDocVw;
...
var list = new ShellWindows().Cast<InternetExplorer>().ToList();
and compiler fails on "ShellWindows()" and "InternetExplorer" with next message:
The type or namespace name 'ShellWindows' could not be found (are you missing a using directive or an assembly reference?)
What Nuget package is required to resolve this problem, either what class and methods can be used instead of current?
Related
I have a .net framework class library project which is absolutely working fine with the .net framework projects, Now I need to refer it in .net core application also. so I am trying to create a new .net standard project and copied all the .cs files to this project from the existing project. and started fixing the compilation errors. I have fixed many but still getting a few.
_rabbitBus = RabbitHutch.CreateBus(
ConfigurationManager.ConnectionStrings[queueName].ConnectionString,
serviceRegister => serviceRegister.Register<ISerializer>(
serviceProvider => new JsonSerializer(new TypeNameSerializer())
)
);
I am getting the below error with the code mentioned above.
CS0246 The type or namespace name 'TypeNameSerializer' could not be
found (are you missing a using directive or an assembly reference?)
So How to solve this issue?
Note: I have fixed the compilation error b using this code new JsonSerializer(new Newtonsoft.Json.JsonSerializerSettings()) , but I don't know whether its correct way or not, So please guide me how to solve this issue.
Looks like different versions of EasyNetQ are being used in .NET Framework and .NET Core.
The latest version of EasyNetQ does not have any class with name TypeNameSerializer that's why you are getting this error.
Also class JsonSerializer in latest version of EasyNetQ does no have a constructor which accepts TypeNameSerializer as a parameter.
You can refer to Git Repo of EasyNetQ and also the Source Code of JsonSerializer class.
You need to use the same version of EasyNetQ in .NET Core as it is being used in .NET Framework project in order to use TypeNameSerializer.
I have .net core (.net core app 1.1) application. I want to integrate pocketsphinx by using the official spinx wrapper.
But I get a lot of errors:
[CS0234] The type or namespace name 'HandleRef' does not exist in the namespace 'System.Runtime.InteropServices' (are you missing an assembly reference?)
How I should modify SWIG interface file? I checked all *.i files in pocketsphinx and sphinxbase to try apply solution from another answer, but I can't find any appopriate to change %typemap(imtype) and %typemap(csbody) entries.
When I am trying to change references in my project from DevExpress 9.2 to DevExpress 11.2 for all of them, I am getting follow exceptions in one of my classes:
<...> The type or namespace name 'DevExpress' could not be found (are you missing a using directive or an assembly reference?) <...>
<...>The type or namespace name 'LayoutControl' could not be found (are you missing a using directive or an assembly reference?) <...>
I am using following references:
DevExpress.Data
DevExpress.Utils
DevExpress.XtraBars
DevExpress.XtraEditors
DevExpress.XtraGrid
DevExpress.XtraLayout
DevExpress.XtraNavBar
When I am using v9.2 – everything is OK, but when I am changing references – I am getting following underlining:
using DevExpress.XtraLayout;
public static string GetLayout(LayoutControl layoutControl)
So, how can I change that references properly?
I think I found: DevExpress 11.2 just not working with .NET 2.0. If you have such problem, you need to change your project's target framework at least to .NET 3.5, or, of course, you can just forget about DevExpress 11.2, and use older versions of it. :)
I'm getting this error with my Visual Studio 2012, Console App (it is a self-hosted webApi OWIN project)....
The type or namespace name 'Configuration' does not exist in the namespace
'WebApiContrib.Formatting.Html' (are you missing an assembly reference?)
The error is coming from this line ...
using WebApiContrib.Formatting.Html.Configuration;
I'm also getting a similar error for ...
using WebApiContrib.Formatting.Html.Formatters;
using WebApiContrib.Formatting.Html.Locators
In the project references I can see...
WebApiContrib.Formatting.Html
Any ideas how I can fix it please?
According to the documentation the HtmlMediaTypeViewFormatter type, and probably others, are found in WebApiContrib.Formatting.Html.Formatting. You don't need the Configuration namespace.
Check if you have installed all necessary packages and the latest version by using the NuGet package manager:
PM> Install-Package WebApiContrib.Formatting.Html
In project i have reference to Microsoft.Office.Word.Server
and in code i have method that takes argument of type ConversionJob, but when i try to compile it i have an errors
The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
The type or namespace name 'ConversionJob' could not be found (are you missing a using directive or an assembly reference?)
but when a press f12 on ConversionJob it tooks me to the class defenition
using Microsoft.Office.Word.Server.Service;
using Microsoft.SharePoint;
using System;
namespace Microsoft.Office.Word.Server.Conversions
{
public class ConversionJob
{
public ConversionJob(WordServiceApplicationProxy serviceApplicationProxy, ConversionJobSettings settings);
public ConversionJob(WordServiceApplicationProxy serviceApplicationProxy);
...
what is wrong?
target framework is .Net framework 3.5
Solution
Ive solve the problem. I look to the output and there was message:
Microsoft.Common.targets(1360,9): warning MSB3268: The primary reference "<assembly reference>" could not be resolved because it has an indirect dependency on the framework assembly "<assembly" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.5". To resolve this problem, either remove the reference "<assembly>" or retarget your application to a framework version which contains "<assembly>"
i try to find solution in google and - > http://www.sanderstechnology.com/2011/warning-msb3268-you-are-about-to-experience-pain/10646/#.TtYrXGP20Z8
Check the target framework of your application, might be you´re building for the client profile but the referenced assembly requires the full framework.
Try changing the "Target Framework" to be ".NET Framework 4" instead of ".NET Framework 4 Client Profile".
Project Properties -> Application Tab -> Target Framework
You likely need to delete (MAKE SURE TO BACK IT UP) the 12.x.x.x .dll in your GAC folder, and make sure you are referencing the 14.x.x.x in your solution.
If you look at the project references, is it finding the assembly? The icon will look different if it can't resolve it.
1.Try to delete and then manualy add the reference (sometimes it helps - VS losting needed dll but not show it with another sign if not clean)
if 1. ok then backup and try to remove from GAC folder (to understatnd from where it calls assembly)
Probably you have a namespace or class with the name Office somewhere in your code. The compiler uses your namespace instead Office.
In other words I think you have a name collision with your project or any of the references you have in it.
Please investigate for overlapping namespaces / classes.