Question received on the Ocean portal:
I got following error. For all PetrelSystem declaration in my code, I got the same error. I added Ocean.Core dll file from new path(Petrel 2012), but that did not help:
The name 'PetrelSystem' does not exist in the current context
the code was copiling correctly on Ocean for Petrel 2011
Static class PetrelSystem is defined in Slb.Ocean.Petrel.Global.dll, not in Core. Core is for non-Petrel stuff. Make sure you have all the libraries included.
There is a small difficulty in moving to 2012 in the fact that some classes that were previously defined in Slb.Ocean.Petrel.dll have been migrated to Slb.Ocean.Petrel.Global.dll
Related
(Visual Studio 2019)
It seems I have run into a snag.
My sample code is this.
Imports NAudio.Wave
Partial Class _Default
Inherits System.Web.UI.Page
Dim filename As String
filename = "G:\VS_Lessons\Media\Read\01. Got to Choose.mp3
Dim reader As New AudioFileReader(filename)
Dim duration As String = reader.TotalTime.ToString("mm\:ss")
reader.Dispose()
Label1.Text = duration
End Sub
End Class
This only happens when I am running the site LIVE and NOT from VS.
Running it through VS, it works as it supposed to.
Running it from a live URL it gives the following error.
Type 'AudioFileReader' is not defined
On this line
Dim reader As New AudioFileReader(filename)
Now, I tried to register the NAudio.dll using. (The NAudio.dll file is in the BIN folder of the website)
gacutil -i NAudio.dll
However, I get the following line
Failure adding assembly to the cache: Attempt to install an assembly without a strong name
I followed the steps in this article here
How to add Strong Name to an existing DLL and install to the GAC
But I get a FAILURE when trying to create the DLL file on STEP 5. (Maybe I am doing it wrong because I am not the owner of the file. Not really sure, this is the first time I have ever done anything like this and was trying everything I could find online)
Any assistance on this would be mighty grateful.
Wayne
The website has to be converted into an Application.
IIS | Web Site |
Right-click on the web site name or sub-folder name
And choose [Convert to Application]
Run the script, and it works.
Now, I have to do this on the live site, but first, I will do the local site, as it runs the same script, and I will get all the bugs out of it, then I can do the LIVE IIS site.
It Could Be Due To Partial Class Instead Of Public Class. Or You Haven't Downloaded Genuine DLL Version Of NAudio.
If Its Problem 1 ( Due To Use Of Partial Class ) Then Change To Public Class
If Its Problem 2 ( Use Of Non-Genuine NAudio DLL ) Then Download NAudio From Here
If Problem Still Persists, Then It Would Be For Windows Form Application.
I am working with ArcGIS 10.5, installed on-premise, and are developing our feature class in .NET.
I have an issue with registering feature classes. We have created a Feature Class and registered the DLL through “ESRIRegAsm.exe”, and it appears in ArcCatalog:
Trigger appearing image
But when I try to create the Feature Class, I get the following error:
Failed to create feature class. Unable to create object class extension COM Component
Which isn't very helpful, unfortunately.
The odd thing is, that we have another trigger registered on another Feature Class, that works as expected. And the new trigger is based on a copy of the old trigger's code (with changed GUID's).
The steps I have done so far:
I have tried to add the feature class to the component category using categories.exe.
Registered it using ESRIRegAsm.exe for both Desktop and Engine.
Checked that there are .ecfg config files - and there are.
Checked that the CLSID's appear in the windows registry.
The essential parts of our trigger source-code can be found here: here.
Any help would be greatly appreciated, as we are stuck on this.
Our issue was that our ID's were wrong in the code.
The ClassExtensionCLSID should return the same ID as TriggerExtension has.
Moreover, InstanceCLSID should always return 52353152-891A-11D0-BEC6-00805F7C4268, and should hence not get a new ID.
I just can't get a handle on how to correct this one. It cropped up about a week ago, and I don't know what change I made could have caused this. We use SVN and I rolled back changes I made of possible culprits of these errors but I am still getting the following errors when I build my asp.net webforms project:
The namespace <global namespace> already contains a definition for 'TrxStatus'
The namespace <global namespace> already contains a definition for 'MessageStatusType'
These two errors are repeated 5 times (10 errors total) and the source files are code generated for the loads of webservices we have in the project.
The file names are App_Code.34kjg234jh1.cs (made up, but you get the idea) and at the top of each one it tells me where it is being generated from:
App_Code\App_WebReferences\SomeService\SomeWebService.wsdl
If I go into the .wsdl definition I believe they do all live in the same namespace based off of this line: (Note, I am not a .wsdl wiz, so tell me if I am wrong)
<s:schema elementFormDefault="qualified" targetNamespace="http://www.thirdpartysite.com/Soa/Foundation/">
<s:import namespace="http://www.thirdpartysite.com/Soa/Foundation/MessageDefinition.xsd" />
This is an application inherited from our prior developer (its a one developer shop here, so I usually get to poke around in the dark) so I don't know why we have about 7 different web services in the application, all with that namespace definition and ALL with the offending 'TrxStatus' and 'MessageStatusType'.
I don't want to change the namespaces, because it is the right namespace (I believe), but I also need this conflict to go away. I am not sure which direction to go.
I attempted to go into one of the .wsdl files and change TrxStatus to TrxStatus_Whatever but that gave me this error:
Unable to import binding 'MyWebServiceName' from namespace http://www.thirdpartysite.com/SOA/Foundation
Another possible clue is I am getting a ton warnings from the various web services that say something like this:
The 'http://www.thirdpartysite.com/Soa/Foundation/MessageDefinition.xsd:SomeElementName' element is not declared.
Any suggestions on possible solutions to this? What is the root cause? Please don't tell me I need to re-write all these services....
I'm by no measure an expert, in fact I do very little ASP.NET & Services.
BUT. It sounds as if there are conflicting imports (i.e usings) that are pulling in types with the same names.
proj1: A.SomeType
proj2: A.SomeType
You can add references to both projects and it play just fine (I believe). But the difficulty comes when you import both namespaces because the type names clash.
You can access the correct type by using the global:: accessor.
You can even use global:: in a using statement.
using A = global::[path to correct project and type here]
Not sure if it'll be much use to you, but there's more info on global:: here:
http://msdn.microsoft.com/en-us/library/c3ay4x3d.aspx
I'm working my way through the book and the Sports Store examples, and generally finding it to be full of great, informative content.
But in Chapter 10 (listing 10-14), we walk though the simple act of adding some validation attributes to the product class, and this breaks the app because VS says the model backing the EFDbContext context has changed (we've only added the validation attributes), and suggests that we enable Code First Migrations to update the database.
The book moves forward without addressing the problem. I am finding that I can't enable migrations because I get this:
PM> enable-migrations -enableautomaticmigrations
No context type was found in the assembly 'SportsStore.WebUI'.
There's no errata for the book, and I'm not sure how to make EF happy without doing the automatic migrations.
Does anyone have experience with this issue in the book, or know how I can move forward after changing my context backing model without migrations enabled?
Remember that you set the default project to WebUI, when you open your package manager console it is set to your default project (WebUI) which does not have the database context, it is located on your Domain project, what you need to do is change the default project from WebUI to Domain, not on your solution settings but on your package manager console. heres a SS:
I am a .NET student and currently we are learning about Application Domains.
We were given the following example code (for .NET 3.5). As expected, it throws a SecurityException. Note: TestApp.exe is added as a reference in the project.
Dim file As String = "TestApp.exe"
Dim hostEvidence As Object() = {New Zone(SecurityZone.Internet)}
Dim appDomainEvidence As Evidence = New Evidence(hostEvidence, Nothing)
Dim d As AppDomain = AppDomain.CreateDomain("MyDomain", appDomainEvidence)
d.ExecuteAssembly(file)
When trying to run this in VS2010 under .NET 4.0 I run into a problem.
First it shows a warning
'Public Sub New(hostEvidence() As Object, assemblyEvidence() As Object)' is obsolete: 'This constructor is obsolete. Please use the constructor which takes arrays of EvidenceBase instead.'.
I change the type of hostEvidence to EvidenceBase() and the warning is gone.
However, when trying to run the application it gives an error.
This method implicitly uses CAS policy, which has been obsoleted by the .NET Framework. In order to enable CAS policy for compatibility reasons, please use the NetFx40_LegacySecurityPolicy configuration switch. Please see http://go.microsoft.com/fwlink/?LinkID=155570 for more information.
I have viewed the page, followed the link to How to: Run Partially Trusted Code in a Sandbox and read http://blogs.msdn.com/shawnfa/archive/2009/05/27/coding-with-security-policy-in-net-4-0-implicit-uses-of-cas-policy.aspx but I'm having trouble understanding all of this.
The code example on MSDN is quite big compared to what I currently have, so any help with changing my code so it works without adding other stuff, will be very appreciated.
As it says in the link you provided, .NET is no longer supporting the policy portion of the code access security framework, as of version 4.0.
In other words, your lesson is about .NET 3.5 and does not pertain to the 4.0 framework. The solution is to revert to your original code and configure your project to target the 3.5 framework (you can still use Visual Studio 2010).
.