I've been working my way through video training series on Microsoft's Virtual Academy. The series I'm watching is titled "Windows 10 Development for Absolute Beginners" I'm at the penultimate video when I ran into a problem. Bob Tabor put the following into the constructor of the App class (in App.xaml.cs):
Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync(
Microsoft.ApplicationInsights.WindowsCollectors.Metadata |
Microsoft.ApplicationInsights.WindowsCollectors.Session);
However, this line doesn't work at all for me. I'm getting red squiggly lines under Microsoft.ApplicationInsights. And when I compile I get the following error message:
The type or namespace name 'ApplicationInsights' does not exist in the
namespace 'Microsoft' (are you missing an assembly reference?)
I have tried to add a reference to that, but it didn't work. In fact VS 2017 told me outright that it was impossible to add the reference I'd found.
I'm thinking that the problem is because I'm using VS 2017, whereas when Bob Tabor did the videos he was using VS 2015. Something has changed in the configuration, but I don't understand what. I'm sure the issue is that I need to include some sort of NuGet package. I'd be delighted to do so, only I've no idea what NuGet package to install.
I'm developing for Windows 10, using Visual Studio 2017 Community Edition.
For the "Windows 10 Development for Absolute Beginners" series videos,there is a correspondent sample here. If you opened one project you are referenced and build, you will find there are three ApplicationInsights relative Nuget packages referenced, and one ApplicationInsights.config file in the project. This should caused by when OS build is 10240, you create a new Windows 10 universal application in Visual Studio that a reference to Microsoft.ApplicationInsights is added to the references folder automatically. And after that, new builds coming without adding this package automatically.
So that if you just need the error gone you may add the same three Nuget packages:Microsoft.ApplicationInsights 1.0.0,Microsoft.ApplicationInsights.WindowsApps 1.0.0,Microsoft.ApplicationInsights.PersistenceChannel 1.0.0 manually.
But actually, Microsoft.ApplicationInsights is not supported UWP app starting 2.0.0. Currently you should not use ApplicationInsights for UWP app which may be deprecated, but use HockeyApp SDK instead.
Related
I have a template project that uses Script# (downloaded from here: https://github.com/scottdurow/SparkleXrm). I've built and deployed this many times so not sure if this is an environmental issue or a version issue. I stripped the solution right down to 2 projects - ClientUi (which references Script#) and a CRMPackage where my HTML page is, but when I build I get the error:
The type or namespace name 'ScriptAssemblyAttribute' could not be found
...and I can't get rid of it. I'm on VS 2017, Windows 10, Project version is .net 4.0 (have tried changing it to 4.5, same problem).
Have tried reapplying Script# via NuGet, but it's just not happy with me and keeps throwing the error. Have tried clearing VS cache, cleaning the build and restarting visual studio, standing on my head, drinking wine, nothing seems to work. In fact I think the wine made it worse.
Help.
For future people hitting this, it's a Visual Studio version issue. Preview 2 broke ScriptSharp compilation. It's something to do with a mismatch in mscorlib versions.
https://developercommunity.visualstudio.com/content/problem/138986/1550-preview-2-breaks-scriptsharp-compilation.html
As per the above link, the fix is setting the following flag in the MSBuild project file:
<DisableHandlePackageFileConflicts>true</DisableHandlePackageFileConflicts>
I know this question is exactly the same as this but even after following it's solution i am still stuck up with this error
error CS0234: The type or namespace name 'Reporting' does not exist in
the namespace 'Microsoft' (are you missing an assembly reference?)
Things i did to install Report Viewer
I followed the below link to install the report viewer
Download and Install Report Viewer For Visual Studio 2017 - YouTube
(this link shows how to install it from NuGet Manager and Extensions and update)
and i was able to make a Report as well as add Report Viewer to my Windows Form
but i am getting the above mentioned error on building the program
Solutions i have tried
I tried re-adding the reference by right-clicking on References folder in my project and then selecting Add Reference. and then adding Assemblies > Extensions > Microsoft.ReportViewer to the references.
I tried unloading the project and changing it's .csproj file and manually mention the version
Also cleaned the whole solution and manually removed any other remaining files in the output directory and rebuilding it.
BUT
when i try to see the designer of the form in which ReportViewer has been inserted then the Tooltip says that it is recognizing the namespace
Now, I am left with no solutions now. Any piece of advice will be appreciated.
Maybe you should try to use NuGet Package for install Reporting Service on your Winform application.
I use this NuGet and it's working fine for me.
Microsoft.ReportingServices.ReportViewerControl.Winforms
The answer was to change my .Net Framework from 4.0 Client Framework to 4.0. I guess it needs full features of that framework rather than the client version for it.
Basically, I'm trying to create an MSBuild Task by inheriting from Microsoft.Build.Utilities.Task. See here for Microsoft's documentation on the class. The error shown is that the Utilities name doesn't exist in the Microsoft.Build namespace.
I know in the image I'm trying to reference Microsoft.Build.Utilties.Core but this was just due to troubleshooting. Utilities is not found. You can see on the right in the image that I've got a reference to Microsoft.Build.Utilities.Core, which I recently installed from Nuget. I've also tried the Visual Studio Installer, checking the box for developing Visual Studio Extensions. Not sure what I'm missing here.
And as it turns out, I had managed to confuse my project names. The project I had added the reference to is not the same as the project this file is in. Oops.
I am building a UWP app on Visual Studio 2015 Update 1. I am encountering errors where Compiler says "async is not a feature of C# 4.0 use 5.0 or greater", "Windows namespace cannot be found"
Error CS8025 Feature 'async function' is not available in C# 4.
Error CS0246 The type or namespace name 'ConnectionProfile'
However upon closing my solution and reopening it these errors disappear. And my app runs(in debug mode). However after a few debug sessions the problem resurfaces.
To Correct any errors on my part I Have :
1> Reset VS user Settings
2>Reinstalled VS
3>Reset Windows 10
But the problem doesn't want to go. I am using Windows 10 Home Edition and also I don't use insider builds. Recreated my project from scratch
As a result even the most basic tasks performed in my code appear erroneous.
Can you revise if you have installed Microsoft.NETCore.UniversalWindowsPlatform as a nuget package? Wen you create a new uwp project, automatically its added.
I had similar problem that some namespaces was not encountered and the answer was this nuget package.
I've been browsing around StackOverflow exploring possible solutions to my issue. For some reason TeamCity is unable to find 'Microsoft.Web.Infrastructure' but I have installed all the required .Net packages. However, I've ran all the tests locally and building the project within Visual Studio returns a successful build.
This is the error which I am experiencing:
App_Start\NinjectWebCommon.cs(9, 40): error CS0234: The type or namespace name 'DynamicModuleHelper' does not exist in the namespace 'Microsoft.Web.Infrastructure' (are you missing an assembly reference?)
Solutions I have tried
Within Visual Studio I was instructed by one StackOverflow thread to set the reference 'Microsoft.Web.Infrastructure' option 'Copy Local' to true. This returned the same result of the error above.
I've deleted all references of 'Microsoft.Web.Infrastructure' and performed a fresh install of this package, I'd had also reinstalled Ninject as well. I didn't specify a particular version. Again, building locally was successful remotely not so much - same error occurred.
Has anyone encountered such issue before? I had also done a fresh clone of the GIT Repository, restored all the NuGet Packages (Which TeamCity does as well) and it built completely fine.
After asking this question I'd continued my investigation. While my continuous integration server is running multiple windows virtual machines, and since TeamCity load balances the builds across these virtual machines some of their configurations were out of sync with the rest. Some of the team code purely in C++, so the version of Microsoft Visual Studio which was installed (Visual Studio Professional 2013) was the incorrect version for my C# project. After attempting to open the project with Visual Studio on one of the selected VM's, I found that Visual Studio didn't understand the csproj file extension.
I installed Visual Studio 2013 Ultimate - this is version I use on my workstation - and thankfully it complied. sometimes within my project, when I request a build it would use older files as TeamCity would cache the files locally. I found setting the to 'clean and re-download' within the VCS options also remedied this issue.