Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

Member 3919049

@Member 3919049
About
Posts
143
Topics
88
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • model for a modern data access layer?
    M Member 3919049

    Hello, can you please describe a data access model for a modern, greenfield enterprise app? Back in 2000, a Bll and Dal were created for each domain entity. Business logic was in the Bll and data access logic was in the Dal. App code would instantiate a Bll and call one of its methods which would in turn instantiate and call a method on a related Dal. This is a proven and effective model and is still a solid fundamental model for basic applications. However, over the last 5 years, there has been increasing emphasis on design patterns like the provider pattern, inversion of control and a general emphasis on testability. So based on all the trends that have emerged, or become more recognized or expected over the last 5 years, can you please describe the data access model that you would propose for a modern, greenfield enterprise app? Pretend you're a principal consultant at a consulting firm and you want to demonstrate the value and sophistication that your firm can bring to the table. Please make a data access layer proposal that would help support this goal.

    Design and Architecture design business regex architecture help

  • text search in tfs at root level
    M Member 3919049

    Hello - My company has a large TFS structure and my team has a requirement to replace references to one site domain with references to another site domain. I was trying to see if there was a way to do this search through TFS itself. In VS, Edit > Find and Replace > Find in Files only searches the sln open in VS which does not satisfy my requirement. File > Source Control > Find in Source Control > Wildcard opens a Search window with Recursive checked by default. However, this search only appears to search file and folder names but not file contents. For example, a search for "string" at the TFS root level should return hundreds of references but only returns a reference to a folder named "string". So is there a way to do a full recursive search for text within the files from the root level of TFS? The ways I described above don't seem to accomplish my goal unless I'm missing something. I'm guessing someone here has had a requirement to something similar to this before....

    .NET (Core and Framework) visual-studio collaboration tutorial question

  • certificate setup question
    M Member 3919049

    including the following parameter with makecert fixed the issue: -sky exchange

    WCF and WF help question csharp wcf cryptography

  • certificate setup question
    M Member 3919049

    Hello - I've imported a certificate into my "Trusted Root Certification Authority Store." The certificate icon has a tiny key image in the upper left-hand corner so the certificate appears to be associated with a private key. However, when I try to add a reference to the WCF service that uses this certificate the system returns the following error message: "It is likely that certificate 'CN=RootCATest' may not have a private key that is capable of key exchange or the process may not have access rights for the private key." Any idea what the problem might be? Based on googling it appears I should be able to right click the cert in my MMC and select "All Tasks" > "Manage Private Keys". However, this menu option is not available for my certificate for some reason. My understanding was that if the cert is in the proper store and it has the key image in the top left corner then everything should be go but this does not appear to be the case....

    WCF and WF help question csharp wcf cryptography

  • A proper DI implementation?
    M Member 3919049

    Hi James - This is the solution that you provided in your last post: "You would have a dependency to IOrderFactory in your controller constructor which would implement create as: return uc.Resolve();" Can you please provide a constructor code block for this? This is the closest constructor I can infer from your post: public OrderController(IOrderFactory creator) { uc.Resolve(); } 1. The factory does the class creation but it's included as a param. So there is another layer of abstraction that sets the appropriate IOrderFactory? What is this additional layer of abstraction and where is it located? 2. So uc.Resolve() should be used to resolve the domain objects used by the controller? I'm assuming that the dependencies are passed down through the interface param? I'm still trying to figure out the pieces and interaction for this.

    ASP.NET tutorial question learning workspace

  • A proper DI implementation?
    M Member 3919049

    Thanks James - You know your stuff

    ASP.NET tutorial question learning workspace

  • A proper DI implementation?
    M Member 3919049

    I got the example in my above post to work. Basically, uc.Resolve() returns an Order object with the Order ILogger set to FileLogger. This is great but how can I persist this dependency? In the following example I would expect the FileLogger to be persisted as the ILogger to be used for all instances of the Order object: UnityContainer uc = new UnityContainer(); uc.RegisterType<ILogger, FileLogger>(); uc.Resolve<Order>(); Order o = new Order(); ILogger logger = o.Logger; However, in this example, although the FileLogger is associated with the object returned from the Resolve method, the subsequent Order instantiation does not have a reference to FileLogger (null). This seems to reflect the most typical scenario because the DI should be done once and then code within the Order object will run independently and try to access the Logger from within the Order object. Are there some sort of settings that I'm missing to be able to persist this configuration?

    ASP.NET tutorial question learning workspace

  • A proper DI implementation?
    M Member 3919049

    So just using a very simple example. I would create the UnityContainer and register the FileLogger like this: UnityContainer uc = new UnityContainer(); uc.RegisterType<ILogger, FileLogger>(); Then in the same code block I would resolve the ILogger for the dependent classes like this for an Order class: uc.Resolve<Order>(); To do this I would need to define an Logger property on the order class like this right?: public ILogger Logger { get; set; } From what you are saying it sounds like an important design goal of dependency injection is that a central class does all of the injection and the classes being injected should not need to know about the container. Is this correct?

    ASP.NET tutorial question learning workspace

  • A proper DI implementation?
    M Member 3919049

    I'm fairly new to dependency injection but it seems like a proper DI implementation will be fairly complex. For example, DI requires a centralized class that manages the configuration and resolves the dependencies at runtime. DI is also based on the concept of using interfaces. For example, a SpecialLogger should use an ILogger interface. The centralized DI manager class will need to register types - for example, associate ILogger to SpecialLogger. SpecialLogger will also need to implement the ILogger interface so SpecialLogger can be used through the DI ILogger interface. Therefore, it seems like a sln using DI will need multiple projects to support DI. Here is an example for logging: * MyCompany.MyDivision.Framework.DI.Management - this would have the DI manager where dependency types are registered and resolved at runtime * MyCompany.MyDivision.Framework.Logging - this would have the implementation of a logging class. The main logging class would need to implement ILogger. * MyCompany.MyDivision.Framework.DI.Interfaces - this would have the ILogger interface. Interfaces would need to be stored in a separate class library from the DI manager because both the DI manager and SpecialLogger use the ILogger interface. Since the DI manager associates SpecialLogger to ILogger a circular reference would be encountered without a separate class library to store the ILogger interface. Does this sound like a reasonable assessment? Like I said I am just learning DI so if you can share any real-world experience with a DI implementation that would be appreciated.

    ASP.NET tutorial question learning workspace

  • Unity DI config implementation question
    M Member 3919049

    Ok - so to implement this as a singleton how would you envision the solution structure? For example, would you see a singleton class in its own class library with a namespace like: "MyCompany.MyDivision.MyApp.DI"? With the singleton class named something like "DIManager"? Then I suppose that every library that needed the DI info would need to add a reference to the custom DI class library? Is this correct?

    C# question game-dev business

  • Unity DI config implementation question
    M Member 3919049

    I am implementing Unity in a business app for the first time. Here is some sample code to implement logging DI with Unity: UnityContainer uc = new UnityContainer(); uc.RegisterType<ILogger, FileLogger>(); ILogger logger = uc.Resolve<ILogger>(); logger.Write(); One way to implement this in an app would be to put this code in an AppConfig.cs class and implement GetLogger as a singleton. What's your preferred way to implement Unity in this scenario?

    C# question game-dev business

  • how to access local website by ip address instead of localhost
    M Member 3919049

    Hi - I have a website that I'm running locally. I have a notification routine on an external public website that needs to pass a url to an ashx handler through my local website (paypal ipn integration). Can I configure my local machine to expose my local website by ip address to accept url requests from an external website? How can I do this? I tried replacing "localhost" in the url with my local ip address. I got my ip address through cmd > ipconfig. http://75.228.51.999:2076/MyWebSite/Login.aspx[^] When I tried to run it with my ip address locally my browser didn't find the page so I'm guessing that this page wouldn't load from an external machine. Also, are there any additional precautions I should take for this from a security perspective? It's probably an easy question but I've just never done it before....

    ASP.NET question security tutorial

  • trying to debug assembly configuration
    M Member 3919049

    It looks like ILMerge does exactly what I need it to do. Examples were kinda hard to find so I'm including one below. This command will take your MyMain.dll and package it with all of the child dlls into a new dll named MyMain.dll so it's transparent to the consumer of your dll: ilmerge /out:MyMain.dll ./dlls/MyMain.dll ./dlls/BusinessObjects.dll ./dlls/DataAccess.dll ./dlls/DataInterface.dll Nice tool!

    ASP.NET debugging question workspace

  • trying to debug assembly configuration
    M Member 3919049

    I did some more research and it looks like Microsoft provides a tool called ILMerge that may do what I'm looking for. http://www.microsoft.com/downloads/details.aspx?familyid=22914587-b4ad-4eae-87cf-b14ae6a939b0&displaylang=en[^] I'll update this thread if ILMerge works well to provide a useful reference for someone else who may need to know how to do this in the future.

    ASP.NET debugging question workspace

  • trying to debug assembly configuration
    M Member 3919049

    Hi Mark - It looks like you earn MVP points no matter what you post (like your last post) cha-ching! automatic MVP point! I respect your professional goals but if you know how to combine multiple dlls into a single dll and you can share that information then that would really be more inline with this thread. Thanks!

    ASP.NET debugging question workspace

  • trying to debug assembly configuration
    M Member 3919049

    My MyService project has references to BusinessObjects, DataInterface and DataAccess projects within its solution. If I copy over the MyService.dll to MyWebsite it looks like (the way MyService is deployed/configured) I will have to copy over all of the additional dll's for projects referenced in MyService.dll. For example, if I copy the MyService BusinessObjects.dll to the GAC then MyWebsite finds the dll and uses it. I'm thinking that there must be a way to include all of the dependent dlls within MyService.dll as opposed to requiring that 4 dlls be copied to MyWebsite in order to use the functionality within MyService.dll. So how can I get all of the dll dependencies into a single MyService.dll?

    ASP.NET debugging question workspace

  • trying to debug assembly configuration
    M Member 3919049

    Thanks Mark - I've done 8 years n-tier dev in ASP.NET so I'm familiar with adding references. The problem here is that MyWebsite has a dll reference to MyService and MyWebsite and MyService have the same tier structure. So when MyService is trying to access it's BusinessObjects project the runtime is actually trying to access to BusinessObjects project of the WebSite. I went ahead and applied a strong name to all of the projects in MyService and then copied the new MyService.dll to the MyWebsite bin directory. When MyService runs in MyWebsite the following error is now returned: Could not load file or assembly 'DataInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=68dd866efa467a61' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) So it looks like MyWebsite runtime now recognizes that MyService is trying to load its own DataInterface project. However, it looks like MyWebsite runtime still tries to load its own DataInterface project but the runtime throws an error b/c it recognizes that the assemblies don't match. Any suggestions on what I should do now?

    ASP.NET debugging question workspace

  • trying to debug assembly configuration
    M Member 3919049

    Here's some more info - MyWebsite and MyService have the same tier structure of BusinessObjects, DataAccess and DataInterface. MyService is not finding a BusinessObject reference. However, I can add that BO reference to MyWebsite and this fixes the MyService error. However, the BusinessObjects definition in MyService should be isolated from the BusinessObjects definition in MyWebsite. Am I supposed to accomplish this through strong-naming the contents of MyService?

    ASP.NET debugging question workspace

  • trying to debug assembly configuration
    M Member 3919049

    I have a website - MyWebSite - that uses the following class library projects within its solution as tiers: BusinessObjects, DataAccess, DataInterface. I have a service - MyService - that uses the same tier structure in its own solution. MyWebSite has a reference to MyService.dll which resides in its bin directory. I have a Tester console app that resides within the MyService solution to test MyService. The Tester console app executes MyService successfully. When I copy MyService.dll to the bin directory of MyWebsite.dll shouldn't MyService.dll be a compilation of itself + the tier class library solutions that it references by default? In other words, shouldn't it be sufficient to just copy over the single MyService.dll without the additional dlls generated by its referenced projects? For some reason the MyService referenced projects aren't found when I copy over MyService.dll to the MyWebsite bin directory.

    ASP.NET debugging question workspace

  • Unable to launch the ASP.NET Development Server. Port 'n' is in use
    M Member 3919049

    I turned off Dynamic ports in VS2008 for a project because I need to configure an external app with a url to my application so the port needs to be the same every time. The problem is now VS returns an error "Unable to launch the ASP.NET Development Server. Port 'n' is in use." How can I get my system to release this port so it can be reserved and used only by my website?

    ASP.NET help question csharp asp-net visual-studio
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups