Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
After updating Prism in a WPF application from version 7.2.0.1422 to version 8.0.0.1909, the GetInstance method no longer works:
CommonServiceLocator.ServiceLocator.Current.GetInstance
The message is issued: “ServiceLocationProvider must be set”
I found that version 8 was missing the Prism.Unity.Wpf.UnityServiceLocatorAdapter class which was present in version 7 and which provided the ServiceLocator to work.
Q: How do I now take advantage of the CommonServiceLocator.ServiceLocator.Current.GetInstance?
The release notes of Prism 8.0 state a breaking change:
Added ContainerLocator (NOTE: This replaces the Common Service Locator in Prism.Wpf)
So, with Prism 8, you write
Prism.Ioc.ContainerLocator.Container
if you absolutely have to access the container...
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I created a Windows Installer package a few years ago and now I found out that there is a typo.
I can't find the source code of this dialog to fix this issue.
Is it maybe a known error in the "wix-toolset" or is there a way to fix this error?
That dialog isn't part of WiX. You need to find out where it's coming from (custom Windows Installer dialog or custom action) and fix it there.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
Can someone teach me how to resolve this issue? Its a Windows Console Application.
I have already implemented and put using System.Web; but there is still the error regarding HttpContext not existing in the current context.
Any idea how to fix it?
For your purpose use any of the below options:
HttpServerUtility.UrlDecode() method in System.Web namespace.
You can refer the details here: https://learn.microsoft.com/en-us/dotnet/api/system.web.httpserverutility.urldecode?view=netframework-4.7.2
WebUtility.UrlDecode() method in System.Net namespace.
You can refer the details here: https://learn.microsoft.com/en-us/dotnet/api/system.net.webutility?view=netframework-4.7.2
Your code using HttpContext is suitable to be used in a Web Application Project.
Thanks #dlatikay, #soulflyman for more insight and helping the community.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
i have following code in a c# class and would need its vb.net equivalent. All online translation tools i found translate this part wrong. A research on the web did not bring me any progress.
public event EventHandler<UploadProgressChangedLibArgs> UploadProgressChanged;
whatever I do I keep getting that uploadprogresschangedlibargs is not defined.
any help appreciated thanks
additional information:
http://sourceforge.net/projects/dotnetftplib/files/
this is the library i am trying to translate
The problem is exactly what the compiler said: the UploadProgressChangedLibArgs type couldn't be found. That's another type within the same library - so you need to port that before you can port an event which uses it.
As noted in comments, I'd advise you to avoid porting C# to VB or vice versa unless you really need to. One of the benefits of .NET is that you can call C# from VB or vice versa - and if you just want to make minor changes to an existing code base, you don't need to port the whole thing - you just need to understand enough of the language it's written in to make that change.
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 4 years ago.
Improve this question
I want to create a deskband app, like BatteryBar, in C#. I understand that the deskband might not work in future versions of windows, that you shouldn't code explorer extensions in managed code, and whatnot. My question is, what is the current reccomended way to create a deskband (or a simulation of one) in C#? Thanks in advance!
This may not answer your question, but it is important information related to your question:
You said,
I understand ... that you shouldn't
code explorer extensions in managed
code
This is no longer true.
This used to be true because the multiple versions of the CLR could not be loaded into a single process. For example, Explorer could not load an extension that used both .NET 2 and .NET 1; the host process would fail to load the second CLR version.
But with .NET 4, which comes with a new CLR, you can now run multiple versions of the CLR in the same process. So if you write your code using .NET 4, you're no longer at risk of making host processes error out.
In short, it is now OK to write Explorer extensions in managed code, provided you're using .NET 4 or greater.
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 6 years ago.
Improve this question
are there any tutorials out there on how to create a sandbox using C#?
I would like to personalize my own one, thanks
Study up on using AppDomains. Here's some code examples.
We just recently used the MonoSandbox for Security reasons.
I don't know if it works with standard Microsoft's CLR, or if it is specific to the Mono implementation, but I think it works better than just a custom sanbdbox using AppDomains, and since the source code is open you can probably find a way to make it work for you.
The best documentation I have found for the MonoSandbox is here: http://www.mono-project.com/MonoSandbox
I would start by looking at Code Access Security.